mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
update bi->biBitCount before using it - fixes 5 gdi32 bitmap winetests
svn path=/trunk/; revision=39172
This commit is contained in:
@@ -1476,15 +1476,6 @@ DIB_CreateDIBSection(
|
||||
NtGdiDeleteObject(bmp);
|
||||
return NULL;
|
||||
}
|
||||
bmp->hDIBSection = section;
|
||||
bmp->hSecure = hSecure;
|
||||
bmp->dwOffset = offset;
|
||||
bmp->flFlags = BITMAPOBJ_IS_APIBITMAP;
|
||||
bmp->dsBitfields[0] = dsBitfields[0];
|
||||
bmp->dsBitfields[1] = dsBitfields[1];
|
||||
bmp->dsBitfields[2] = dsBitfields[2];
|
||||
bmp->biClrUsed = bi->biClrUsed;
|
||||
bmp->biClrImportant = bi->biClrImportant;
|
||||
|
||||
/* WINE NOTE: WINE makes use of a colormap, which is a color translation
|
||||
table between the DIB and the X physical device. Obviously,
|
||||
@@ -1496,6 +1487,16 @@ DIB_CreateDIBSection(
|
||||
if(bi->biBitCount == 4) { bi->biClrUsed = 16; } else
|
||||
if(bi->biBitCount == 8) { bi->biClrUsed = 256; }
|
||||
|
||||
bmp->hDIBSection = section;
|
||||
bmp->hSecure = hSecure;
|
||||
bmp->dwOffset = offset;
|
||||
bmp->flFlags = BITMAPOBJ_IS_APIBITMAP;
|
||||
bmp->dsBitfields[0] = dsBitfields[0];
|
||||
bmp->dsBitfields[1] = dsBitfields[1];
|
||||
bmp->dsBitfields[2] = dsBitfields[2];
|
||||
bmp->biClrUsed = bi->biClrUsed;
|
||||
bmp->biClrImportant = bi->biClrImportant;
|
||||
|
||||
if (bi->biClrUsed != 0)
|
||||
bmp->hDIBPalette = PALETTE_AllocPaletteIndexedRGB(bi->biClrUsed, lpRGB);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user