diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-11-21 19:41:59 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-01-12 17:59:40 +0100 |
commit | f1b3cc02ec5eda0bcbce10236cc2254d22048b17 (patch) | |
tree | ec9f4b2c5572db13abea4ca34b2f42150171d5d3 | |
parent | b6592b402cd245fa4ac74f8eea4e0f9300c62adc (diff) | |
download | ffmpeg-f1b3cc02ec5eda0bcbce10236cc2254d22048b17.tar.gz |
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@libav.org
(cherry picked from commit 0b300daad2f5cb59a7c06dde5ac701685e6edf16)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/h264.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1c5b841889..c9940da97f 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2889,6 +2889,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 |