Initialize more structure members, including biSizeImage if bits ==

NULL and biBitCount != 0.
This commit is contained in:
Michael Kaufmann 2005-06-17 13:56:25 +00:00 committed by Alexandre Julliard
parent 811e966083
commit a5abe264c9
1 changed files with 20 additions and 0 deletions

View File

@ -961,9 +961,29 @@ INT WINAPI GetDIBits(
bmp->bitmap.bmHeight, bmp->bitmap.bmHeight,
bmp->bitmap.bmBitsPixel ); bmp->bitmap.bmBitsPixel );
info->bmiHeader.biCompression = 0; info->bmiHeader.biCompression = 0;
info->bmiHeader.biXPelsPerMeter = 0;
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrUsed = 0;
info->bmiHeader.biClrImportant = 0;
/* Windows 2000 doesn't touch the additional struct members if
it's a BITMAPV4HEADER or a BITMAPV5HEADER */
} }
lines = abs(bmp->bitmap.bmHeight); lines = abs(bmp->bitmap.bmHeight);
} }
else
{
/* The knowledge base article Q81498 ("DIBs and Their Uses") states that
if bits == NULL and bpp != 0, only biSizeImage and the color table are
filled in. */
if (!core_header)
{
/* FIXME: biSizeImage should be calculated according to the selected
compression algorithm if biCompression != BI_RGB */
info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes( width, height, bpp );
}
lines = abs(height);
}
} }
if (!core_header) if (!core_header)