On 18 Apr 2016, at 09:11, Michael Stefaniuc mstefani@redhat.de wrote:
--- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -617,10 +617,8 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT MoveToEx(c->hDC, c->pt.x, y + bounds->top, NULL); LineTo(c->hDC, c->pt.x, y + para->nHeight - bounds->bottom); if (border_details[idx].dble) {
rc.left = c->pt.x + 1;
rc.right = rc.left + border_width;
rc.top = y + bounds->top;
rc.bottom = y + para->nHeight - bounds->bottom;
SetRect(&rc, c->pt.x + 1, y + bounds->top, rc.left + border_width,
y + para->nHeight - bounds->bottom);
This is using rc.left uninitialised.
Huw.
On 04/18/2016 01:31 PM, Huw Davies wrote:
On 18 Apr 2016, at 09:11, Michael Stefaniuc mstefani@redhat.de wrote:
--- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -617,10 +617,8 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT MoveToEx(c->hDC, c->pt.x, y + bounds->top, NULL); LineTo(c->hDC, c->pt.x, y + para->nHeight - bounds->bottom); if (border_details[idx].dble) {
rc.left = c->pt.x + 1;
rc.right = rc.left + border_width;
rc.top = y + bounds->top;
rc.bottom = y + para->nHeight - bounds->bottom;
SetRect(&rc, c->pt.x + 1, y + bounds->top, rc.left + border_width,
y + para->nHeight - bounds->bottom);
This is using rc.left uninitialised.
Thanks Huw for catching this!
I have amended my coccinelle script to generate compile failures in those cases. There were two more of those in my patch.
How do you prefer to handle this cases? Still use SetRect() or leave them open coded?
thanks bye michael
On 18 Apr 2016, at 13:37, Michael Stefaniuc mstefani@redhat.com wrote:
I have amended my coccinelle script to generate compile failures in those cases. There were two more of those in my patch.
How do you prefer to handle this cases? Still use SetRect() or leave them open coded?
I'd prefer those open coded, so it’s obvious what the width or height is.
Huw.