mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
mfvideoenc: Fix huge memory leak
Subclass must unref passed GstVideoCodecFrame on GstVideoEncoder::handle_frame() Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1294>
This commit is contained in:
parent
5a2c358a2b
commit
b93fbdd3cd
1 changed files with 6 additions and 3 deletions
|
@ -296,7 +296,6 @@ gst_mf_video_enc_process_input (GstMFVideoEnc * self,
|
|||
|
||||
if (!gst_video_frame_map (&vframe, info, frame->input_buffer, GST_MAP_READ)) {
|
||||
GST_ERROR_OBJECT (self, "Couldn't map input frame");
|
||||
gst_video_codec_frame_unref (frame);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -522,11 +521,12 @@ gst_mf_video_enc_handle_frame (GstVideoEncoder * enc,
|
|||
GstVideoCodecFrame * frame)
|
||||
{
|
||||
GstMFVideoEnc *self = GST_MF_VIDEO_ENC (enc);
|
||||
GstFlowReturn ret;
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
|
||||
if (!gst_mf_video_enc_process_input (self, frame)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to process input");
|
||||
return GST_FLOW_ERROR;
|
||||
ret = GST_FLOW_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
do {
|
||||
|
@ -536,6 +536,9 @@ gst_mf_video_enc_handle_frame (GstVideoEncoder * enc,
|
|||
if (ret == GST_MF_TRANSFORM_FLOW_NEED_DATA)
|
||||
ret = GST_FLOW_OK;
|
||||
|
||||
done:
|
||||
gst_video_codec_frame_unref (frame);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue