diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 6aa1e4641..5f8a68fd8 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -244,6 +244,9 @@ xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap, uint64_t modifier; int i; + if (xwl_pixmap == NULL) + return NULL; + if (xwl_pixmap->buffer) { /* Buffer already exists. Return it and inform caller if interested. */ if (created) @@ -494,6 +497,9 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, xwl_pixmap = xwl_pixmap_get(pixmap); + if (xwl_pixmap == NULL) + return 0; + if (!xwl_pixmap->bo) return 0;