From c9594fe0fb6dd123fa25cb27fe5bc976ff3a9051 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 20 Mar 2012 15:36:28 -0400 Subject: [PATCH] avconv: free packet in write_frame() when discarding due to frame number limit Fixes a memleak when using the -frames option with audio. --- avconv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/avconv.c b/avconv.c index affb87742e..9a3c75d59e 100644 --- a/avconv.c +++ b/avconv.c @@ -887,8 +887,10 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) * reordering, see do_video_out() */ if (!(avctx->codec_type == AVMEDIA_TYPE_VIDEO && avctx->codec)) { - if (ost->frame_number >= ost->max_frames) + if (ost->frame_number >= ost->max_frames) { + av_free_packet(pkt); return; + } ost->frame_number++; }