mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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
This commit is contained in:
parent
f82cec2ce3
commit
4bb41e6ca3
1 changed files with 3 additions and 2 deletions
|
@ -2823,8 +2823,7 @@ gst_vaapi_encoder_h264_fei_encode (GstVaapiEncoder * base_encoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the slice array */
|
/* 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);
|
gst_vaapi_enc_picture_unref (picture2);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2841,6 +2840,8 @@ error:
|
||||||
reconstruct);
|
reconstruct);
|
||||||
if (picture2)
|
if (picture2)
|
||||||
gst_vaapi_enc_picture_unref (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;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue