mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
surface: destroy derived image
If gst_vaapi_image_new_with_image() fails, the created derived image should be destroyed, otherwise the surface cannot be processed because is being used. https://bugzilla.gnome.org/show_bug.cgi?id=764607
This commit is contained in:
parent
506c9e2b5b
commit
bb0b8ce7ab
1 changed files with 5 additions and 1 deletions
|
@ -624,6 +624,7 @@ gst_vaapi_surface_derive_image (GstVaapiSurface * surface)
|
||||||
GstVaapiDisplay *display;
|
GstVaapiDisplay *display;
|
||||||
VAImage va_image;
|
VAImage va_image;
|
||||||
VAStatus status;
|
VAStatus status;
|
||||||
|
GstVaapiImage *image;
|
||||||
|
|
||||||
g_return_val_if_fail (surface != NULL, NULL);
|
g_return_val_if_fail (surface != NULL, NULL);
|
||||||
|
|
||||||
|
@ -640,7 +641,10 @@ gst_vaapi_surface_derive_image (GstVaapiSurface * surface)
|
||||||
if (va_image.image_id == VA_INVALID_ID || va_image.buf == VA_INVALID_ID)
|
if (va_image.image_id == VA_INVALID_ID || va_image.buf == VA_INVALID_ID)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return gst_vaapi_image_new_with_image (display, &va_image);
|
image = gst_vaapi_image_new_with_image (display, &va_image);
|
||||||
|
if (!image)
|
||||||
|
vaDestroyImage (GST_VAAPI_DISPLAY_VADISPLAY (display), va_image.image_id);
|
||||||
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue