summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2019-07-19 10:53:19 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2019-10-11 12:03:42 +0000
commit744c419cb4eaed4006b5f0f319b72d7ffa9fbc6d (patch)
tree994f490cd77a3c04855338d9bfa5975f96ff65b1 /glamor
parent7667180fb9dbd606e40c000aefc807371d2fb478 (diff)
glamor: check for non NULL pixmap at close_screen
DDX such as Xorg, Xwayland & Xephyr do not destroy the pixmap before they call into CloseScreen. At the same time Xvfb (support for glamor coming with later commit) do. As such the pixmap will be NULL and we'll crash out. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 4b935de59..6b8cfe9b7 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -927,7 +927,11 @@ glamor_close_screen(ScreenPtr screen)
ps->Glyphs = glamor_priv->saved_procs.glyphs;
screen_pixmap = screen->GetScreenPixmap(screen);
- glamor_pixmap_destroy_fbo(screen_pixmap);
+ /* For DDX like Xwayland and Xorg, the pixmap is not destroyed so
+ * we should do so here.
+ */
+ if (screen_pixmap)
+ glamor_pixmap_destroy_fbo(screen_pixmap);
glamor_release_screen_priv(screen);