OSDN Git Service

Add missing av_free_packet.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 20 Feb 2012 20:20:04 +0000 (21:20 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 20 Feb 2012 20:23:00 +0000 (21:23 +0100)
Fixes memory leak when encoding at least with mpegvideo using the
new encode2 function.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
ffmpeg.c

index 8f6f039..8d727a3 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1633,6 +1633,7 @@ static void do_video_out(AVFormatContext *s, OutputStream *ost,
                 write_frame(s, &pkt, ost);
                 frame_size = pkt.size;
                 video_size += pkt.size;
+                av_free_packet(&pkt);
 
                 /* if two pass, output log */
                 if (ost->logfile && enc->stats_out) {