[ros-diffs] [tkreuzer] 56521: [WIN32K] Fix regression of gdi32_winetest palette
tkreuzer at svn.reactos.org
tkreuzer at svn.reactos.org
Sat May 5 22:50:47 UTC 2012
Author: tkreuzer
Date: Sat May 5 22:50:47 2012
New Revision: 56521
URL: http://svn.reactos.org/svn/reactos?rev=56521&view=rev
Log:
[WIN32K]
Fix regression of 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?rev=56521&r1=56520&r2=56521&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Sat May 5 22:50:47 2012
@@ -148,9 +148,12 @@
/* Loop all color indices in the DIB */
for (i = 0; i < cColors; i++)
{
- /* Get the RGB value from the DC palette, indexed by the DIB
- color table value */
- crColor = PALETTE_ulGetRGBColorFromIndex(ppalDC, pwColors[i]);
+ /* Get the palette index and handle wraparound when exceeding
+ the number of colors in the DC palette */
+ WORD wIndex = pwColors[i] % ppalDC->NumColors;
+
+ /* USe the RGB value from the DC palette */
+ crColor = PALETTE_ulGetRGBColorFromIndex(ppalDC, wIndex);
PALETTE_vSetRGBColorForIndex(ppal, i, crColor);
}
}
More information about the Ros-diffs
mailing list