mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
dmabuf: Require valid fds for all planes
This seems to be what everyone does, so we should do it, too. Previously it was assumed that an fd of -1 would mean reusing the previous fd with a different offset, but that seems to be uncommon.
This commit is contained in:
parent
5b6fcfe8c9
commit
cbfd8542c6
@ -964,6 +964,8 @@ gdk_dmabuf_texture_builder_build (GdkDmabufTextureBuilder *self,
|
||||
gpointer data,
|
||||
GError **error)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DMABUF_TEXTURE_BUILDER (self), NULL);
|
||||
g_return_val_if_fail (destroy == NULL || data != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
@ -971,8 +973,8 @@ gdk_dmabuf_texture_builder_build (GdkDmabufTextureBuilder *self,
|
||||
g_return_val_if_fail (self->height > 0, NULL);
|
||||
g_return_val_if_fail (self->dmabuf.fourcc != 0, NULL);
|
||||
|
||||
for (int i = 0; i < self->dmabuf.n_planes; i++)
|
||||
g_return_val_if_fail (self->dmabuf.planes[i].fd != -1 || self->dmabuf.planes[i].offset != 0, NULL);
|
||||
for (i = 0; i < self->dmabuf.n_planes; i++)
|
||||
g_return_val_if_fail (self->dmabuf.planes[i].fd != -1, NULL);
|
||||
|
||||
if (GDK_DEBUG_CHECK (DMABUF_DISABLE))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user