From 0a010adfc2717200e3f2acf345ef2802cfaaa146 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 5 Dec 2017 22:09:06 +0100 Subject: Coverity # 337: Remove useless NULL check. Backported from X.org: Commit 6bb2dc02a7cffd6ed7dd28e88d584920a4150749 Author: Adam Jackson Date: Wed Mar 15 16:01:47 2006 +0000 Coverity # 337: Remove useless NULL check. Backported-to-NX-by: Ulrich Sibiller --- nx-X11/programs/Xserver/miext/cw/cw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/miext') diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c index d9ca55f7e..a45c34dff 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.c +++ b/nx-X11/programs/Xserver/miext/cw/cw.c @@ -463,7 +463,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) DrawablePtr pBackingDrawable; int x_off, y_off, x_screen, y_screen; - while (pWin && pWin->backgroundState == ParentRelative) + while (pWin->backgroundState == ParentRelative) pWin = pWin->parent; pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off, -- cgit v1.2.3 From e073093cc9ea46eb1740440d286c2874b98fd3ae Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 5 Dec 2017 22:14:22 +0100 Subject: devPrivates fixes Backported from X.Org: commit 0693083335185ce05ee64546151f3fc43ce98575 Author: Lars Knoll Date: Mon Mar 6 21:00:09 2006 +0000 render/picture.c Correctly initialize devPrivates variable in source only pictures to 0 miext/cw/cw.h Don't try to access devPrivates of source only pictures Backported-from-NX-by: Ulrich Sibiller --- nx-X11/programs/Xserver/miext/cw/cw.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/miext') diff --git a/nx-X11/programs/Xserver/miext/cw/cw.h b/nx-X11/programs/Xserver/miext/cw/cw.h index de4746be6..b8792661f 100644 --- a/nx-X11/programs/Xserver/miext/cw/cw.h +++ b/nx-X11/programs/Xserver/miext/cw/cw.h @@ -60,7 +60,8 @@ typedef struct { unsigned long stateChanges; } cwPictureRec, *cwPicturePtr; -#define getCwPicture(pPicture) ((cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr) +#define getCwPicture(pPicture) \ + (pPicture->pDrawable ? (cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr : 0) #define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (void *) (p)) extern int cwPictureIndex; -- cgit v1.2.3