From c011267b972fbe4381cdfd09b7192e374eb1e6eb Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 15 Nov 1998 18:10:11 +0000 Subject: [PATCH] Fixed retrieval of invalid palette data in GetDIBits(). --- objects/dib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/objects/dib.c b/objects/dib.c index 24097503ae..82226fb7b0 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -461,12 +461,13 @@ INT32 WINAPI GetDIBits32( return 0; } - /* Transfer color info */ + /* Transfer color info (FIXME) */ - if (info->bmiHeader.biBitCount<=8) { - int colors = info->bmiHeader.biClrUsed; - if (!colors && (info->bmiHeader.biBitCount <= 8)) - colors = 1 << info->bmiHeader.biBitCount; + if (info && (info->bmiHeader.biBitCount <= 8) && + (bmp->bitmap.bmBitsPixel <= 8)) + { + int colors = 1 << info->bmiHeader.biBitCount; + info->bmiHeader.biClrUsed = 0; palEntry = palette->logpalette.palPalEntry; for (i = 0; i < colors; i++, palEntry++) {