summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-14 13:02:19 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-14 13:03:35 +0200
commitfd4c87fa3becaf8a6c480db915daf51e297b76c5 (patch)
tree78e92f9c4833c20a5ac25843a7db0e7bc6dca62c /ffmpeg.c
parentbd27dc910248a5da1ac187ac0dd1d1e22bc54a04 (diff)
ffmpeg: Fix crash with ost->last_frame allocation failure
Fixes: 1013dbde2c360d939cc2dfc33e4f275c_signal_sigsegv_a0500f_45_320vp3.nsv with memlimit of 536870912 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index cff9dbc033..cb5018704d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1227,7 +1227,7 @@ static void do_video_out(AVFormatContext *s,
if (!ost->last_frame)
ost->last_frame = av_frame_alloc();
av_frame_unref(ost->last_frame);
- if (next_picture)
+ if (next_picture && ost->last_frame)
av_frame_ref(ost->last_frame, next_picture);
else
av_frame_free(&ost->last_frame);