avcodec/tta: Don't try to read more than MIN_CACHE_BITS bits

This fixes assertion failures introduced in 4fbb56acbe.

Reviewed-by: michaelni
Reviewed-by: durandal_1707
This commit is contained in:
James Almer 2017-04-07 12:48:31 -03:00
parent 08117a4015
commit 7c1566fec3

View File

@ -285,7 +285,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
}
if (k) {
if (k >= 32 || unary > INT32_MAX >> k) {
if (k > MIN_CACHE_BITS || unary > INT32_MAX >> k) {
ret = AVERROR_INVALIDDATA;
goto error;
}