mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
libs: encoder: h264fei: don't free memory on stack
Issue detected by Coverity `info_to_pak` variable in gst_vaapi_encoder_h264_fei_encode() is declared in the stack, but it is free in gst_vaapi_feienc_h264_encode() as if declared on the heap. This patch initializes the structure and removes the free. A non-heap pointer is placed on the free list, likely causing a crash later. In gst_vaapi_encoder_h264_fei_encode: Free of an address-of expression, which can never be heap allocated.
This commit is contained in:
parent
6ecbb8d100
commit
47b0932911
2 changed files with 1 additions and 2 deletions
|
@ -2741,7 +2741,7 @@ gst_vaapi_encoder_h264_fei_encode (GstVaapiEncoder * base_encoder,
|
||||||
GstVaapiEncoderStatus status = GST_VAAPI_ENCODER_STATUS_ERROR_UNKNOWN;
|
GstVaapiEncoderStatus status = GST_VAAPI_ENCODER_STATUS_ERROR_UNKNOWN;
|
||||||
GstVaapiSurfaceProxy *reconstruct = NULL;
|
GstVaapiSurfaceProxy *reconstruct = NULL;
|
||||||
GstVaapiEncPicture *picture2 = NULL;
|
GstVaapiEncPicture *picture2 = NULL;
|
||||||
GstVaapiFeiInfoToPakH264 info_to_pak;
|
GstVaapiFeiInfoToPakH264 info_to_pak = { {0} };
|
||||||
|
|
||||||
reconstruct = gst_vaapi_encoder_create_surface (base_encoder);
|
reconstruct = gst_vaapi_encoder_create_surface (base_encoder);
|
||||||
|
|
||||||
|
|
|
@ -1403,7 +1403,6 @@ gst_vaapi_feienc_h264_encode (GstVaapiEncoder * base_encoder,
|
||||||
return GST_VAAPI_ENCODER_STATUS_SUCCESS;
|
return GST_VAAPI_ENCODER_STATUS_SUCCESS;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
g_slice_free (GstVaapiFeiInfoToPakH264, info_to_pak);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue