aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-10 00:56:45 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-10 01:10:55 +0200
commited3c9b5b0dd5abb545c48e930e1c32c187b0776a (patch)
tree030324f858dc4eda6c8d866992bd78a806fe2887
parentddb2dd7edbccc5596d8e3c039133be8444cb1d02 (diff)
downloadffmpeg-ed3c9b5b0dd5abb545c48e930e1c32c187b0776a.tar.gz
avcodec/lagarith: Check scale_factor
Fixes: 1425/clusterfuzz-testcase-minimized-6295712339853312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/lagarith.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 044497720f..1f4afc5312 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -191,7 +191,9 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
}
scale_factor++;
- cumulative_target = 1 << scale_factor;
+ if (scale_factor >= 32U)
+ return AVERROR_INVALIDDATA;
+ cumulative_target = 1U << scale_factor;
if (scaled_cumul_prob > cumulative_target) {
av_log(rac->avctx, AV_LOG_ERROR,