[FFmpeg-cvslog] avconv: free packet in write_frame() when discarding due to frame number limit
Justin Ruggles
git at videolan.org
Wed Mar 21 02:35:05 CET 2012
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Mar 20 15:36:28 2012 -0400| [c9594fe0fb6dd123fa25cb27fe5bc976ff3a9051] | committer: Justin Ruggles
avconv: free packet in write_frame() when discarding due to frame number limit
Fixes a memleak when using the -frames option with audio.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9594fe0fb6dd123fa25cb27fe5bc976ff3a9051
---
avconv.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/avconv.c b/avconv.c
index affb877..9a3c75d 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++;
}
More information about the ffmpeg-cvslog
mailing list