[1/2] comctl32: Fix an off by one error in ImageList_Remove. Take 2

Dmitry Timoshkov dmitry at codeweavers.com
Mon Apr 23 06:39:00 CDT 2007


Hello,

Alexandre pointed out that my patch that removes bounds checks is not correct,
and since this patch depends on it, here is a resend.

This patch fixes a bug in Outlook shortcut bar.

Changelog:
    comctl32: Fix an off by one error in 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 0e314dd..df1f920 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -2126,13 +2126,13 @@ ImageList_Remove (HIMAGELIST himl, INT i)
             TRACE("Post image copy!\n");
 
             SelectObject (hdcBmp, hbmNewImage);
-            imagelist_copy_images( himl, himl->hdcImage, hdcBmp, i,
-                                   (himl->cCurImage - i - 1), i - 1 );
+            imagelist_copy_images( himl, himl->hdcImage, hdcBmp, i + 1,
+                                   (himl->cCurImage - i), i );
 
             if (himl->hbmMask) {
                 SelectObject (hdcBmp, hbmNewMask);
-                imagelist_copy_images( himl, himl->hdcMask, hdcBmp, i,
-                                       (himl->cCurImage - i - 1), i - 1 );
+                imagelist_copy_images( himl, himl->hdcMask, hdcBmp, i + 1,
+                                       (himl->cCurImage - i), i );
             }
         }
 
-- 
1.5.1.1






More information about the wine-patches mailing list