aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-27 18:02:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:46 +0100
commit22336d5c480a8cf06f0ee0cfe9e8b02ffe592916 (patch)
tree70e3bd80feaee3c2c908e72be7a4cac449540273
parent888df4b68ce6fd4c920509588000a634ff900f88 (diff)
downloadffmpeg-22336d5c480a8cf06f0ee0cfe9e8b02ffe592916.tar.gz
avcodec/adpcm: Check initial predictor for ADPCM_IMA_EA_EACS
Fixes: signed integer overflow: -2147483360 - 631 cannot be represented in type 'int' Fixes: 17701/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_EA_EACS_fuzzer-5711517319692288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2f66e8436d89963362acf533a60ed4fedb42546e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/adpcm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 295241ce2b..938b09bfb5 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1138,8 +1138,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
}
- for (i=0; i<=st; i++)
+ for (i=0; i<=st; i++) {
c->status[i].predictor = bytestream2_get_le32u(&gb);
+ if (FFABS(c->status[i].predictor) > (1<<16))
+ return AVERROR_INVALIDDATA;
+ }
for (n = nb_samples >> (1 - st); n > 0; n--) {
int byte = bytestream2_get_byteu(&gb);