diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 59169be5dea5231324fd8149f333ae02d6df1059..0a45812bc14f38c481f2d316976e8e0cd1579854 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -226,6 +226,9 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) } } + if (scale_factor > 23) + return AVERROR_INVALIDDATA; + rac->scale = scale_factor; /* Fill probability array with cumulative probability for each symbol. */