diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-03 23:42:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-08 23:19:15 +0100 |
commit | 3f86cc06808423b585d2f6a70ad3e252854a5d1a (patch) | |
tree | 5d3484752a5f6670845164c0c8be54a7b842d49f /libavcodec | |
parent | c4ead1ab27f4a00dcc7f0e6a2a2794220fd607d5 (diff) | |
download | ffmpeg-3f86cc06808423b585d2f6a70ad3e252854a5d1a.tar.gz |
avcodec/h264_slice: Do not attempt to render into frames already output
Fixes: null pointer dereference
Fixes: 4698/clusterfuzz-testcase-minimized-5096956322906112
This testcase does not reproduce the issue before 03b82b3ab9883cef017e513c7d0b3b986b3b3e7b
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 476665d4de989dba48ec1195215ccc8db54538f4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264_slice.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index ce1fc18219..1c56ad2ee9 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1462,6 +1462,12 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, * one except for reference purposes. */ h->first_field = 1; h->cur_pic_ptr = NULL; + } else if (h->cur_pic_ptr->reference & DELAYED_PIC_REF) { + /* This frame was already output, we cannot draw into it + * anymore. + */ + h->first_field = 1; + h->cur_pic_ptr = NULL; } else { /* Second field in complementary pair */ h->first_field = 0; |