From: Huw Davies Subject: [PATCH 2/2] gdi32: Use the helper to retrieve the number of colours. Message-Id: <1311863655-13492-2-git-send-email-huw@codeweavers.com> Date: Thu, 28 Jul 2011 15:34:15 +0100 --- dlls/gdi32/dib.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 99baf67..5adafcb 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -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)