diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-07-26 19:07:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-07-26 19:08:39 +0100 |
commit | d11dc75fb5a95ba410fedd86d9e1dd50260af979 (patch) | |
tree | 6c9d2d35dccbbd7dd11fa683471be07775c4855c /src/sna/sna.h | |
parent | e5f8f90f686879950766babbe805cd9d2412aca3 (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>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r-- | src/sna/sna.h | 6 |
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 |