summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-12-17 13:22:12 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-12-17 17:57:09 +0100
commit6ecbb8d100cc3ac71f2d52191c8a6527bc35498d (patch)
tree33a62d822d81a470242d3bf4a53ba172c2c76eeb
parentb55b0538c934df0fcabb5f9955a136ce9468494e (diff)
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
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c
index ea5c4952..f5d74a6e 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c
@@ -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;