summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-12-17 17:09:37 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-12-17 18:31:36 +0100
commit4bb41e6ca3973176046f92d7dcd7a4f63f08dd1c (patch)
treecd81c3a29dfb980bdb3b2596073b6ead7e11752f
parentf82cec2ce309af61e3bee41735ed847eb9bd041f (diff)
libs: encoder: h264fei: remove unnecessary check
Issue detected by Coverity `info_to_pack.h264_slice_header` is always allocated by gst_vaapi_feipak_h264_encode(), thus checking it to free it afterwards in doesn't make much sense. But it requires to be free on the error path. There may be a null pointer dereference, or else the comparison against null is unnecessary. In gst_vaapi_encoder_h264_fei_encode: All paths that lead to this null pointer comparison already dereference the pointer earlier
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c
index d643a6a6..eeec20aa 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c
@@ -2823,8 +2823,7 @@ gst_vaapi_encoder_h264_fei_encode (GstVaapiEncoder * base_encoder,
}
/* Free the slice array */
- if (info_to_pak.h264_slice_headers)
- g_array_free (info_to_pak.h264_slice_headers, TRUE);
+ g_array_free (info_to_pak.h264_slice_headers, TRUE);
gst_vaapi_enc_picture_unref (picture2);
} else {
@@ -2841,6 +2840,8 @@ error:
reconstruct);
if (picture2)
gst_vaapi_enc_picture_unref (picture2);
+ if (info_to_pak.h264_slice_headers)
+ g_array_free (info_to_pak.h264_slice_headers, TRUE);
return status;
}
}