mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
wayland/dma-buf: Handle getting dma-buf from detached buffer handle
We might still have a MetaWaylandBuffer for a wl_buffer that was destroyed. Handle trying to fetch the MetaWaylandDmaBufBuffer from such a buffer gracefully. https://gitlab.gnome.org/GNOME/mutter/merge_requests/798
This commit is contained in:
parent
03c00e4944
commit
4b1805c306
@ -282,6 +282,9 @@ static const struct wl_buffer_interface dma_buf_buffer_impl =
|
||||
MetaWaylandDmaBufBuffer *
|
||||
meta_wayland_dma_buf_from_buffer (MetaWaylandBuffer *buffer)
|
||||
{
|
||||
if (!buffer->resource)
|
||||
return NULL;
|
||||
|
||||
if (wl_resource_instance_of (buffer->resource, &wl_buffer_interface,
|
||||
&dma_buf_buffer_impl))
|
||||
return wl_resource_get_user_data (buffer->resource);
|
||||
|
Loading…
Reference in New Issue
Block a user