mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 22:48:49 +00:00
libs: surface: fix double free when dmabuf export fails
Happens if vaAcquireBufferHandle fails.
This commit is contained in:
parent
a3ce4446c1
commit
aa37f31d54
1 changed files with 1 additions and 1 deletions
|
@ -36,6 +36,7 @@ gst_vaapi_surface_get_drm_buf_handle (GstVaapiSurface * surface, guint type)
|
||||||
if (!image)
|
if (!image)
|
||||||
goto error_derive_image;
|
goto error_derive_image;
|
||||||
|
|
||||||
|
/* The proxy takes ownership if the image, even creation failure. */
|
||||||
proxy =
|
proxy =
|
||||||
gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
|
gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
|
||||||
image->internal_image.buf, type, gst_vaapi_object_unref, image);
|
image->internal_image.buf, type, gst_vaapi_object_unref, image);
|
||||||
|
@ -52,7 +53,6 @@ error_derive_image:
|
||||||
error_alloc_export_buffer:
|
error_alloc_export_buffer:
|
||||||
{
|
{
|
||||||
GST_ERROR ("failed to allocate export buffer proxy");
|
GST_ERROR ("failed to allocate export buffer proxy");
|
||||||
gst_vaapi_object_unref (image);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue