aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-01-03 23:42:01 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-19 02:40:54 +0100
commit06325d77bf12dead2126e42cf89a7fd601691a5f (patch)
tree3f1e848469d6d8de560b2c15c1efbb65094f7fb4
parent0c753a46efe2ec43bd2f1c5bbdd4c46e83af421e (diff)
downloadffmpeg-06325d77bf12dead2126e42cf89a7fd601691a5f.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>
-rw-r--r--libavcodec/h264_slice.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c0b3b67e49..0afd49bac5 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1633,6 +1633,12 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
h->missing_fields ++;
h->cur_pic_ptr = NULL;
h->first_field = FIELD_PICTURE(h);
+ } 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 {
h->missing_fields = 0;
if (h->cur_pic_ptr->frame_num != h->frame_num) {