From 6772873396dfe5f0b124c9b63c00e18fe3804037 Mon Sep 17 00:00:00 2001
From: Mike McCormack <mike@codeweavers.com>
Date: Sun, 5 Nov 2006 17:59:19 +0900
Subject: [PATCH] comctl32: Remove a Nx1 assuption in ImageList_AddMasked().

---
 dlls/comctl32/imagelist.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index 3f8b49face0..20da02f17f7 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -300,7 +300,7 @@ INT WINAPI
 ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
 {
     HDC    hdcMask, hdcBitmap;
-    INT    nIndex, nImageCount, nMaskXOffset=0;
+    INT    nIndex, nImageCount;
     BITMAP bmp;
     HBITMAP hOldBitmap;
     HBITMAP hMaskBitmap=0;
@@ -331,7 +331,6 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
     if(himl->hbmMask)
     {
         hdcMask = himl->hdcMask;
-        nMaskXOffset = nIndex * himl->cx;
         imagelist_point_from_index( himl, nIndex, &pt );
     }
     else
@@ -343,7 +342,6 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
         hdcMask = CreateCompatibleDC(0);
         hMaskBitmap = CreateBitmap(bmp.bmWidth, bmp.bmHeight, 1, 1, NULL);
         SelectObject(hdcMask, hMaskBitmap);
-        nMaskXOffset = 0;
         imagelist_point_from_index( himl, 0, &pt );
     }
     /* create monochrome image to the mask bitmap */
@@ -370,7 +368,7 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
     BitBlt(hdcBitmap,
         0, 0, bmp.bmWidth, bmp.bmHeight,
         hdcMask,
-        nMaskXOffset, 0,
+        pt.x, pt.y,
         0x220326); /* NOTSRCAND */
     /* Copy result to the imagelist
     */
-- 
GitLab