summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-11-21 19:41:59 +0100
committerJanne Grunau <janne-libav@jannau.net>2012-12-02 23:24:53 +0100
commit0b300daad2f5cb59a7c06dde5ac701685e6edf16 (patch)
treec62b747e9f1a7d36e246962b3a9c1374749c31a4 /libavcodec
parent89a4465bd9d12c794434dace4332875e57c61a6b (diff)
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
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index e3075cbe6f..7bdd6f1ed2 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