Commit 1afd2469 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 55d7371f
...@@ -2330,6 +2330,8 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void ...@@ -2330,6 +2330,8 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN; s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) { 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. // Wait for previous thread to read mb_x+2, and reach mb_y-1.
if (prev_td != td) { if (prev_td != td) {
if (threadnr != 0) { if (threadnr != 0) {
......
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