[ros-diffs] [gschneider] 44770: [win32k] Handle invalid palette index by using the first palette entry

gschneider at svn.reactos.org gschneider at svn.reactos.org
Sun Dec 27 16:43:49 CET 2009


Author: gschneider
Date: Sun Dec 27 16:43:48 2009
New Revision: 44770

URL: http://svn.reactos.org/svn/reactos?rev=44770&view=rev
Log:
[win32k] Handle invalid palette index by using the first palette entry

Modified:
    trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c?rev=44770&r1=44769&r2=44770&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Sun Dec 27 16:43:48 2009
@@ -694,6 +694,12 @@
             pdc = DC_LockDc(hDC);
             if (IntGetPaletteEntries(pdc->dclevel.hpal, LOWORD(*Color), 1, &palEntry) == 1)
             {
+                *Color = RGB(palEntry.peRed, palEntry.peGreen, palEntry.peBlue);
+            }
+            else
+            {
+                /* Index does not exist, use zero index */
+                IntGetPaletteEntries(pdc->dclevel.hpal, 0, 1, &palEntry);
                 *Color = RGB(palEntry.peRed, palEntry.peGreen, palEntry.peBlue);
             }
             DC_UnlockDc(pdc);




More information about the Ros-diffs mailing list