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>
This commit is contained in:
parent
24171bb710
commit
76a329e55c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue