Commit b79fc165 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Avoid division by zero when the imagelist is created with a width of

zero (ie no images).
parent 919bd785
......@@ -284,7 +284,10 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment