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/ob…
==============================================================================
--- 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);