aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/gc.c')
-rw-r--r--xorg-server/dix/gc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xorg-server/dix/gc.c b/xorg-server/dix/gc.c
index 1fb577e53..d7657c210 100644
--- a/xorg-server/dix/gc.c
+++ b/xorg-server/dix/gc.c
@@ -261,12 +261,14 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
case GCStipple:
NEXT_PTR(PixmapPtr, pPixmap);
- if ((pPixmap->drawable.depth != 1) ||
- (pPixmap->drawable.pScreen != pGC->pScreen)) {
+ if (pPixmap && ((pPixmap->drawable.depth != 1) ||
+ (pPixmap->drawable.pScreen != pGC->pScreen)))
+ {
error = BadMatch;
}
else {
- pPixmap->refcnt++;
+ if (pPixmap)
+ pPixmap->refcnt++;
if (pGC->stipple)
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
pGC->stipple = pPixmap;