mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
winex11: Fix a null pointer bug in ToLogical in case of 8-bit. Move the code to the place where the shifts are needed.
This commit is contained in:
parent
da2db26dec
commit
2d1f55cce2
1 changed files with 5 additions and 4 deletions
|
@ -791,10 +791,6 @@ BOOL X11DRV_IsSolidColor( COLORREF color )
|
|||
COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel)
|
||||
{
|
||||
XColor color;
|
||||
ColorShifts *shifts = &X11DRV_PALETTE_default_shifts;
|
||||
|
||||
if(physDev->color_shifts)
|
||||
shifts = physDev->color_shifts;
|
||||
|
||||
#if 0
|
||||
/* truecolor visual */
|
||||
|
@ -806,6 +802,11 @@ COLORREF X11DRV_PALETTE_ToLogical(X11DRV_PDEVICE *physDev, int pixel)
|
|||
|
||||
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;
|
||||
if (shifts->logicalRed.scale<8)
|
||||
color.red= color.red << (8-shifts->logicalRed.scale) |
|
||||
|
|
Loading…
Reference in a new issue