[FFmpeg-cvslog] avcodec/h264_slice: Do not attempt to render into frames already output

Michael Niedermayer git at videolan.org
Thu Feb 1 01:52:48 EET 2018


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan  3 23:42:01 2018 +0100| [761362fffb8661be98831234c49eb2314f1802b1] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 476665d4de989dba48ec1195215ccc8db54538f4)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=761362fffb8661be98831234c49eb2314f1802b1
---

 libavcodec/h264_slice.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 033dd2ab85..cbebec3c18 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1634,6 +1634,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) {



More information about the ffmpeg-cvslog mailing list