summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-07-26 19:07:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-07-26 19:08:39 +0100
commitd11dc75fb5a95ba410fedd86d9e1dd50260af979 (patch)
tree6c9d2d35dccbbd7dd11fa683471be07775c4855c
parente5f8f90f686879950766babbe805cd9d2412aca3 (diff)
sna: Only check non-NULL Pixmaps
check_pixmap() can be called very early in the Window setup proceeding, before a pixmap is even assigned to a Window. There we expect the Window to be NULL, so be more careful in our check_pixmap. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c16 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 5b3569e2..6c4d1795 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -184,8 +184,10 @@ static inline WindowPtr get_root_window(ScreenPtr screen)
#if !NDEBUG
static PixmapPtr check_pixmap(PixmapPtr pixmap)
{
- assert(pixmap->refcnt >= 1);
- assert(pixmap->devKind != 0xdeadbeef);
+ if (pixmap != NULL) {
+ assert(pixmap->refcnt >= 1);
+ assert(pixmap->devKind != 0xdeadbeef);
+ }
return pixmap;
}
#else