[PATCH] winex11.drv: physDev cannot be NULL (Coverity)

Marcus Meissner marcus at jet.franken.de
Wed Jan 6 11:58:55 CST 2010


Hi,

physDev is later on dereferenced anyway, and nearly
call callers assume a non-NULL physDev (most of them
deref physDev before).

Ciao, Marcus
---
 dlls/winex11.drv/palette.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c
index 81bb73b..a02501f 100644
--- a/dlls/winex11.drv/palette.c
+++ b/dlls/winex11.drv/palette.c
@@ -881,7 +881,7 @@ static inline BOOL colour_is_brighter(RGBQUAD c1, RGBQUAD c2)
 int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
 {
     WORD 		 index = 0;
-    HPALETTE hPal = physDev ? GetCurrentObject(physDev->hdc, OBJ_PAL ) : GetStockObject(DEFAULT_PALETTE);
+    HPALETTE 		 hPal = GetCurrentObject(physDev->hdc, OBJ_PAL );
     unsigned char	 spec_type = color >> 24;
     int *mapping = palette_get_mapping( hPal );
     PALETTEENTRY entry;
-- 
1.5.6



More information about the wine-patches mailing list