diff options
author | Simon Ser <contact@emersion.fr> | 2023-02-27 14:41:37 +0100 |
---|---|---|
committer | Olivier Fourdan <fourdan@gmail.com> | 2023-03-03 08:35:54 +0000 |
commit | 76a329e55c34e2d60a0b1d92bf61bbf3baf5dd41 (patch) | |
tree | 0489c597d425f12ab57c58fb73de9ef1191a850f | |
parent | 24171bb71010a90f1ac323be49121c1503658567 (diff) | |
download | xserver-76a329e55c34e2d60a0b1d92bf61bbf3baf5dd41.tar.gz |
xwayland: fix error path when modifier is not supported
When the modifier is not supported by the compositor, and the
DMA-BUF contains multiple planes, xwl_pixmap->buffer is NULL.
Avoid crashing when calling wl_buffer_add_listener().
Signed-off-by: Simon Ser <contact@emersion.fr>
-rw-r--r-- | hw/xwayland/xwayland-glamor-gbm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 3984d0b38..2d42bbba3 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -446,8 +446,9 @@ xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap) close(prime_fds[i]); /* Add our listener now */ - wl_buffer_add_listener(xwl_pixmap->buffer, - &xwl_glamor_gbm_buffer_listener, pixmap); + if (xwl_pixmap->buffer) + wl_buffer_add_listener(xwl_pixmap->buffer, + &xwl_glamor_gbm_buffer_listener, pixmap); return xwl_pixmap->buffer; } |