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:
Víctor Manuel Jáquez Leal 2019-12-17 16:49:47 +01:00
parent 6ecbb8d100
commit 47b0932911
2 changed files with 1 additions and 2 deletions

View file

@ -2741,7 +2741,7 @@ gst_vaapi_encoder_h264_fei_encode (GstVaapiEncoder * base_encoder,
GstVaapiEncoderStatus status = GST_VAAPI_ENCODER_STATUS_ERROR_UNKNOWN;
GstVaapiSurfaceProxy *reconstruct = NULL;
GstVaapiEncPicture *picture2 = NULL;
GstVaapiFeiInfoToPakH264 info_to_pak;
GstVaapiFeiInfoToPakH264 info_to_pak = { {0} };
reconstruct = gst_vaapi_encoder_create_surface (base_encoder);

View file

@ -1403,7 +1403,6 @@ gst_vaapi_feienc_h264_encode (GstVaapiEncoder * base_encoder,
return GST_VAAPI_ENCODER_STATUS_SUCCESS;
error:
g_slice_free (GstVaapiFeiInfoToPakH264, info_to_pak);
return ret;
}