mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
[WIN32K]
Fix palette index wraparound when initializing a DIB palette with DIB_PAL_COLORS. Fixes gdi32_winetest::palette svn path=/trunk/; revision=56430
This commit is contained in:
@@ -1744,9 +1744,6 @@ DIB_MapPaletteColors(PPALETTE ppal, CONST BITMAPINFO* lpbmi)
|
||||
nNumColors = min(nNumColors, lpbmi->bmiHeader.biClrUsed);
|
||||
}
|
||||
|
||||
/* Don't have more colors than we need */
|
||||
nNumColors = min(ppal->NumColors, nNumColors);
|
||||
|
||||
ppalEntries = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * nNumColors, TAG_COLORMAP);
|
||||
if (ppalEntries == NULL)
|
||||
{
|
||||
@@ -1758,17 +1755,7 @@ DIB_MapPaletteColors(PPALETTE ppal, CONST BITMAPINFO* lpbmi)
|
||||
|
||||
for (i = 0; i < nNumColors; i++)
|
||||
{
|
||||
if (*lpIndex < ppal->NumColors)
|
||||
{
|
||||
ppalEntries[i] = ppal->IndexedColors[*lpIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
ppalEntries[i].peRed = 0;
|
||||
ppalEntries[i].peGreen = 0;
|
||||
ppalEntries[i].peBlue = 0;
|
||||
ppalEntries[i].peFlags = 0;
|
||||
}
|
||||
ppalEntries[i] = ppal->IndexedColors[*lpIndex % ppal->NumColors];
|
||||
|
||||
lpIndex++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user