mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
tinus <o112w8r02@sneakemail.com>
Don't allocate 0 bytes of memory for no color map. svn path=/trunk/; revision=13933
This commit is contained in:
parent
fc556dfcc1
commit
c350cae866
1 changed files with 9 additions and 2 deletions
|
@ -883,9 +883,16 @@ DIB_CreateDIBSection(
|
|||
if(bi->biBitCount == 4) { Entries = 16; } else
|
||||
if(bi->biBitCount == 8) { Entries = 256; }
|
||||
|
||||
if (Entries)
|
||||
{
|
||||
bmp->ColorMap = ExAllocatePoolWithTag(PagedPool, sizeof(RGBQUAD)*Entries, TAG_COLORMAP);
|
||||
RtlCopyMemory(bmp->ColorMap, bmi->bmiColors, sizeof(RGBQUAD)*Entries);
|
||||
}
|
||||
else
|
||||
{
|
||||
bmp->ColorMap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up in case of errors
|
||||
if (!res || !bmp || !dib || !bm.bmBits)
|
||||
|
|
Loading…
Reference in a new issue