Fail if less then one entire line requested in GetBitmapBits32.

This commit is contained in:
Uwe Bonnes 1998-11-07 12:25:18 +00:00 committed by Alexandre Julliard
parent cb505623c1
commit 1f43de3456
1 changed files with 7 additions and 0 deletions

View File

@ -288,6 +288,13 @@ LONG WINAPI GetBitmapBits32(
height = count / bmp->bitmap.bmWidthBytes;
if (height > bmp->bitmap.bmHeight) height = bmp->bitmap.bmHeight;
count = height * bmp->bitmap.bmWidthBytes;
if (count == 0)
{
WARN(bitmap, "Less then one entire line requested\n");
GDI_HEAP_UNLOCK( hbitmap );
return 0;
}
TRACE(bitmap, "(%08x, %ld, %p) %dx%d %d colors fetched height: %ld\n",
hbitmap, count, bits, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,