Commit d61e1ffa authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Use the helper to retrieve the number of colours.

parent 3460665c
......@@ -147,14 +147,12 @@ static BOOL bitmapinfo_from_user_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *
if (bitmap_type == -1) return FALSE;
colors = (bpp > 8) ? 0 : 1 << bpp;
if (bitmap_type == 1)
{
dst->bmiHeader = info->bmiHeader;
dst->bmiHeader.biSize = sizeof(dst->bmiHeader);
if (info->bmiHeader.biClrUsed) colors = info->bmiHeader.biClrUsed;
colors = get_dib_num_of_colors( dst );
if (info->bmiHeader.biCompression == BI_BITFIELDS)
/* bitfields are always at bmiColors even in larger structures */
......@@ -184,6 +182,8 @@ static BOOL bitmapinfo_from_user_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *
dst->bmiHeader.biClrUsed = 0;
dst->bmiHeader.biClrImportant = 0;
colors = get_dib_num_of_colors( dst );
if (colors)
{
if (coloruse == DIB_PAL_COLORS)
......
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