Module: wine Branch: master Commit: 23dbdab4fe6177cc9b006e1adf4b98635c09520d URL: http://source.winehq.org/git/wine.git/?a=commit;h=23dbdab4fe6177cc9b006e1adf...
Author: Huw Davies huw@codeweavers.com Date: Wed Oct 19 16:08:26 2016 +0100
comctl32: Make the position variables signed to avoid wrapping in the HDF_RIGHT case.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comctl32/header.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index edfe385..224ff9e 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -406,11 +406,12 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
/* Now text and image */ { - UINT rw, rh, /* width and height of r */ - *x = NULL, *w = NULL; /* x and width of the pic (bmp or img) which is part of cnt */ + INT rw, rh; /* width and height of r */ + INT *x = NULL; /* x and ... */ + UINT *w = NULL; /* ... width of the pic (bmp or img) which is part of cnt */ /* cnt,txt,img,bmp */ - UINT cx, tx, ix, bx, - cw, tw, iw, bw; + INT cx, tx, ix, bx; + UINT cw, tw, iw, bw; INT img_cx, img_cy; BITMAP bmp;
@@ -501,14 +502,14 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU if (bw) { HDC hdcBitmap = CreateCompatibleDC (hClipDC); SelectObject (hdcBitmap, phdi->hbm); - BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2, + BitBlt (hClipDC, bx, r.top + (rh - bmp.bmHeight) / 2, bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY); DeleteDC (hdcBitmap); }
if (iw) { ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC, - ix, r.top + ((INT)rh - img_cy) / 2, + ix, r.top + (rh - img_cy) / 2, img_cx, img_cy, CLR_DEFAULT, CLR_DEFAULT, 0); }