user32: Fix bitmap_info_size to take into account bit field masks.
This commit is contained in:
parent
652602f5c8
commit
be900067b6
|
@ -223,7 +223,7 @@ static int get_dib_width_bytes( int width, int depth )
|
|||
*/
|
||||
static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse )
|
||||
{
|
||||
int colors;
|
||||
int colors, masks = 0;
|
||||
|
||||
if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
|
||||
{
|
||||
|
@ -239,7 +239,8 @@ static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse )
|
|||
colors = 256;
|
||||
if (!colors && (info->bmiHeader.biBitCount <= 8))
|
||||
colors = 1 << info->bmiHeader.biBitCount;
|
||||
return sizeof(BITMAPINFOHEADER) + colors *
|
||||
if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
|
||||
return sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) + colors *
|
||||
((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue