diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c index 968f86bf29..bc5a4e30eb 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c @@ -75,7 +75,10 @@ gst_vaapi_picture_destroy(GstVaapiPicture *picture) g_object_unref(picture->proxy); picture->proxy = NULL; } - + else if (picture->surface) { + /* Explicitly release any surface that was not bound to a proxy */ + gst_vaapi_context_put_surface(GET_CONTEXT(picture), picture->surface); + } picture->surface_id = VA_INVALID_ID; picture->surface = NULL;