Author: tkreuzer
Date: Thu Apr 26 16:32:01 2012
New Revision: 56430
URL:
http://svn.reactos.org/svn/reactos?rev=56430&view=rev
Log:
[WIN32K]
Fix palette index wraparound when initializing a DIB palette with DIB_PAL_COLORS. Fixes
gdi32_winetest::palette
Modified:
trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Thu Apr 26 16:32:01 2012
@@ -1744,9 +1744,6 @@
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 @@
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++;
}