[FFmpeg-cvslog] h264: error out on unset current_picture_ptr for h->current_slice > 0

Janne Grunau git at videolan.org
Mon Dec 3 02:00:55 CET 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Wed Nov 21 19:41:59 2012 +0100| [0b300daad2f5cb59a7c06dde5ac701685e6edf16] | committer: Janne Grunau

h264: error out on unset current_picture_ptr for h->current_slice > 0

Fixes a segfault with fuzzed sample sample_varPAR_s11622_r001-02.avi.

CC: libav-stable at libav.org

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

 libavcodec/h264.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index e3075cb..7bdd6f1 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2624,6 +2624,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
             s->picture_structure = last_pic_structure;
             s->dropable          = last_pic_dropable;
             return AVERROR_INVALIDDATA;
+        } else if (!s->current_picture_ptr) {
+            av_log(s->avctx, AV_LOG_ERROR,
+                   "unset current_picture_ptr on %d. slice\n",
+                   h0->current_slice + 1);
+            return AVERROR_INVALIDDATA;
         }
     } else {
         /* Shorten frame num gaps so we don't have to allocate reference



More information about the ffmpeg-cvslog mailing list