aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-18 05:27:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-28 02:42:14 +0200
commit568c1b8166b111d41e6b416e6d98244072fb087a (patch)
tree699df0b3699e0341c5330ee17f46f4733f290712
parent3903a60d4beeb46cda5d830be2eb2bac76171ce8 (diff)
downloadffmpeg-568c1b8166b111d41e6b416e6d98244072fb087a.tar.gz
ffmpeg: Free last_frame instead of just unref
Fixes Ticket4611 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d1050d9950610aa2b27878b67bb2b902dd717e7c) Conflicts: ffmpeg.c
-rw-r--r--ffmpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 6e640e387f..60d8e8905f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1142,7 +1142,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)