From 613e4466b4586d86cc9af2cf3515438842e3362c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 18 Jan 2024 16:44:14 +0100 Subject: [PATCH] xwayland: Handle NULL xwl_pixmap in xwl_shm_pixmap_get_wl_buffer --- hw/xwayland/xwayland-shm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-shm.c b/hw/xwayland/xwayland-shm.c index ff128316d..4788e1671 100644 --- a/hw/xwayland/xwayland-shm.c +++ b/hw/xwayland/xwayland-shm.c @@ -314,7 +314,12 @@ xwl_shm_destroy_pixmap(PixmapPtr pixmap) struct wl_buffer * xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap) { - return xwl_pixmap_get(pixmap)->buffer; + struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap); + + if (!xwl_pixmap) + return NULL; + + return xwl_pixmap->buffer; } Bool