Avoid division by zero when the imagelist is created with a width of
zero (ie no images).
This commit is contained in:
parent
919bd7855f
commit
b79fc16577
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue