From 2d94a1cbccf517732b3440ae09672959a84a0fe0 Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Mon, 2 Nov 2015 10:00:55 +0900 Subject: [PATCH] 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 --- ext/libav/gstavvidenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c index fde18a232d..e161732095 100644 --- a/ext/libav/gstavvidenc.c +++ b/ext/libav/gstavvidenc.c @@ -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)