libs: encoder: h264fei: fix surface leak

Issue detected by Coverity

If the FEI mode is not handled the created resources should be
released and return and error code.

The system resource will not be reclaimed and reused, reducing the
future availability of the resource.

In gst_vaapi_encoder_h264_fei_encode: Leak of memory or pointers to
system resources
This commit is contained in:
Víctor Manuel Jáquez Leal 2019-12-17 13:22:12 +01:00
parent b55b0538c9
commit 6ecbb8d100

View file

@ -2827,7 +2827,9 @@ gst_vaapi_encoder_h264_fei_encode (GstVaapiEncoder * base_encoder,
g_array_free (info_to_pak.h264_slice_headers, TRUE);
gst_vaapi_enc_picture_unref (picture2);
} else {
GST_ERROR ("invalid FEI mode");
goto error;
}
return GST_VAAPI_ENCODER_STATUS_SUCCESS;