avcodec/mpeg12dec: check for overread in mpeg1_fast_decode_block_inter()

No speedloss meassured

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-01-24 16:46:43 +01:00
parent 746350ea0f
commit 0a59055167
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *bloc
}
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;
UPDATE_CACHE(re, &s->gb);
}