Commit d82eccea authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpeg12dec: check block index in mpeg2_fast_decode_block_non_intra()

Prevents some overreads at the cost of 1 cpu cycle
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0c8e5fb2
...@@ -489,8 +489,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, ...@@ -489,8 +489,9 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
} }
block[j] = level; block[j] = level;
if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF) if (((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF || i >= 64)
break; break;
UPDATE_CACHE(re, &s->gb); UPDATE_CACHE(re, &s->gb);
} }
end: end:
......
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