summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);