[FFmpeg-cvslog] ffmpeg: Free last_frame instead of just unref

Michael Niedermayer git at videolan.org
Mon Jul 20 10:48:19 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Thu Jun 18 05:27:08 2015 +0200| [a5e8ca7e73f8aa7eade5541b6ca3cee66cff7cf0] | committer: Michael Niedermayer

ffmpeg: Free last_frame instead of just unref

Fixes Ticket4611

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d1050d9950610aa2b27878b67bb2b902dd717e7c)

Conflicts:

	ffmpeg.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5e8ca7e73f8aa7eade5541b6ca3cee66cff7cf0
---

 ffmpeg.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index bd75d40..a37bcd8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1155,7 +1155,10 @@ static void do_video_out(AVFormatContext *s,
     if (!ost->last_frame)
         ost->last_frame = av_frame_alloc();
     av_frame_unref(ost->last_frame);
-    av_frame_ref(ost->last_frame, next_picture);
+    if (next_picture)
+        av_frame_ref(ost->last_frame, next_picture);
+    else
+        av_frame_free(&ost->last_frame);
 }
 
 static double psnr(double d)



More information about the ffmpeg-cvslog mailing list