diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-20 15:36:28 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-20 15:51:58 -0400 |
commit | c9594fe0fb6dd123fa25cb27fe5bc976ff3a9051 (patch) | |
tree | 53b09ddc3eb36cb5356f7ccc6200eef89298a0a6 | |
parent | e056f8d37dfc1252a288b0272256a7562a870003 (diff) | |
download | ffmpeg-c9594fe0fb6dd123fa25cb27fe5bc976ff3a9051.tar.gz |
avconv: free packet in write_frame() when discarding due to frame number limit
Fixes a memleak when using the -frames option with audio.
-rw-r--r-- | avconv.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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++; } |