Commit 2d1f55cc authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

winex11: Fix a null pointer bug in ToLogical in case of 8-bit. Move the code to…

winex11: Fix a null pointer bug in ToLogical in case of 8-bit. Move the code to the place where the shifts are needed.
parent da2db26d
...@@ -791,10 +791,6 @@ BOOL X11DRV_IsSolidColor( COLORREF color ) ...@@ -791,10 +791,6 @@ BOOL X11DRV_IsSolidColor( COLORREF color )
COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel) COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel)
{ {
XColor color; XColor color;
ColorShifts *shifts = &X11DRV_PALETTE_default_shifts;
if(physDev->color_shifts)
shifts = physDev->color_shifts;
#if 0 #if 0
/* truecolor visual */ /* truecolor visual */
...@@ -806,6 +802,11 @@ COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel) ...@@ -806,6 +802,11 @@ COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel)
if ( (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) && !X11DRV_PALETTE_Graymax ) if ( (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) && !X11DRV_PALETTE_Graymax )
{ {
ColorShifts *shifts = &X11DRV_PALETTE_default_shifts;
if(physDev->color_shifts)
shifts = physDev->color_shifts;
color.red = (pixel >> shifts->logicalRed.shift) & shifts->logicalRed.max; color.red = (pixel >> shifts->logicalRed.shift) & shifts->logicalRed.max;
if (shifts->logicalRed.scale<8) if (shifts->logicalRed.scale<8)
color.red= color.red << (8-shifts->logicalRed.scale) | color.red= color.red << (8-shifts->logicalRed.scale) |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment