Image List can be created with a width of zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog:
Avoid division by zero when the imagelist is created with a width of
zero (ie no images)

Index: dlls/comctl32/imagelist.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/imagelist.c,v
retrieving revision 1.74
diff -u -r1.74 imagelist.c
--- dlls/comctl32/imagelist.c	13 May 2003 03:36:27 -0000	1.74
+++ dlls/comctl32/imagelist.c	28 Aug 2003 22:09:39 -0000
@@ -284,7 +284,10 @@
     if (!GetObjectA (hBitmap, sizeof(BITMAP), &bmp))
         return -1;
 
-    nImageCount = bmp.bmWidth / himl->cx;
+    if (himl->cx > 0)
+	nImageCount = bmp.bmWidth / himl->cx;
+    else
+	nImageCount = 0;
 
     IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmWidth, bmp.bmHeight);
 




[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux