xwayland/eglstream: Handle xwl_pixmap_get returning NULL

In xwl_glamor_eglstream_get_wl_buffer_for_pixmap. This can likely be hit
now with an SHM pixmap via the Present flip path. There might be other
corner cases.

Fixes: f3eb1684fa "xwayland: enable MIT-SHM shared pixmaps"
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Michel Dänzer 2021-05-18 17:56:50 +02:00 committed by Michel Dänzer
parent d163e0a1d5
commit 3641c24bd0
1 changed files with 6 additions and 1 deletions

View File

@ -334,7 +334,12 @@ xwl_glamor_eglstream_destroy_pixmap(PixmapPtr pixmap)
static struct wl_buffer *
xwl_glamor_eglstream_get_wl_buffer_for_pixmap(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;
}
static void