Mike McCormack : comctl32: Remove another Nx1 assumption from ImageList_Remove().

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 6 05:48:33 CST 2006


Module: wine
Branch: master
Commit: 4e5f56a8e09014b3709cbf4f3951793e26aa3b9e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4e5f56a8e09014b3709cbf4f3951793e26aa3b9e

Author: Mike McCormack <mike at codeweavers.com>
Date:   Sun Nov  5 17:10:54 2006 +0900

comctl32: Remove another Nx1 assumption from ImageList_Remove().

---

 dlls/comctl32/imagelist.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index 99c83be..8ebc326 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -2073,7 +2073,8 @@ ImageList_Remove (HIMAGELIST himl, INT i
 {
     HBITMAP hbmNewImage, hbmNewMask;
     HDC     hdcBmp;
-    INT     cxNew, nCount;
+    INT     nCount;
+    SIZE    sz;
 
     TRACE("(himl=%p i=%d)\n", himl, i);
 
@@ -2106,7 +2107,6 @@ ImageList_Remove (HIMAGELIST himl, INT i
         himl->hbmImage = hbmNewImage;
 
         if (himl->hbmMask) {
-            SIZE sz;
 
             imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
             hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
@@ -2121,7 +2121,6 @@ ImageList_Remove (HIMAGELIST himl, INT i
 
         /* create new bitmap(s) */
         nCount = (himl->cCurImage + himl->cGrow - 1);
-	cxNew = nCount * himl->cx;
 
         TRACE(" - Number of images: %d / %d (Old/New)\n",
                  himl->cCurImage, himl->cCurImage - 1);
@@ -2130,8 +2129,9 @@ ImageList_Remove (HIMAGELIST himl, INT i
 
         hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, nCount, himl->cy);
 
+        imagelist_get_bitmap_size(himl, nCount, himl->cy, &sz );
         if (himl->hbmMask)
-            hbmNewMask = CreateBitmap (cxNew, himl->cy, 1, 1, NULL);
+            hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
         else
             hbmNewMask = 0;  /* Just to keep compiler happy! */
 




More information about the wine-cvs mailing list