aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-07 19:09:39 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:32 +0200
commit678dd7cf209556f1e1d5b291ec391189e2d84ee2 (patch)
treea3df6f5e89ac1505ed19b54050678cfe220cf88c
parent45abce9e05e66e145f82dabccba73c3768526582 (diff)
downloadffmpeg-678dd7cf209556f1e1d5b291ec391189e2d84ee2.tar.gz
avcodec/vp8: Check for the bitstream end per MB in decode_mb_row_no_filter()
Fixes: timeout in 730/clusterfuzz-testcase-5265113739165696 (part 2 of 2) Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: BBB Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1afd246960202917e244c844c534e9c1e3c323f5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vp8.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 6c6fb8d601..1de604dafc 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2329,6 +2329,8 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
+ if (c->end <= c->buffer && c->bits >= 0)
+ return AVERROR_INVALIDDATA;
// Wait for previous thread to read mb_x+2, and reach mb_y-1.
if (prev_td != td) {
if (threadnr != 0) {