Commit 0b300daa authored by Janne Grunau's avatar 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@libav.org
parent 89a4465b
...@@ -2624,6 +2624,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0) ...@@ -2624,6 +2624,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
s->picture_structure = last_pic_structure; s->picture_structure = last_pic_structure;
s->dropable = last_pic_dropable; s->dropable = last_pic_dropable;
return AVERROR_INVALIDDATA; 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 { } else {
/* Shorten frame num gaps so we don't have to allocate reference /* Shorten frame num gaps so we don't have to allocate reference
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment