avvidenc: Fix frame memory leak

The frame being passed to handle_frame should be unref'ed in all cases

https://bugzilla.gnome.org/show_bug.cgi?id=757453
This commit is contained in:
Vineeth TM 2015-11-02 10:00:55 +09:00 committed by Sebastian Dröge
parent e5b9e11383
commit 2d94a1cbcc

View file

@ -626,6 +626,7 @@ gst_ffmpegvidenc_handle_frame (GstVideoEncoder * encoder,
GST_ERROR_OBJECT (encoder, "Failed to map input buffer");
gst_buffer_unref (buffer_info->buffer);
g_slice_free (BufferInfo, buffer_info);
gst_video_codec_frame_unref (frame);
return GST_FLOW_ERROR;
}
@ -665,7 +666,10 @@ gst_ffmpegvidenc_handle_frame (GstVideoEncoder * encoder,
/* Encoder needs more data */
if (!have_data)
{
gst_video_codec_frame_unref (frame);
return GST_FLOW_OK;
}
/* save stats info if there is some as well as a stats file */
if (ffmpegenc->file && ffmpegenc->context->stats_out)