Browse Source

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 2f66e8436d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.15
Michael Niedermayer 6 years ago
parent
commit
a2d319fe34
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/adpcm.c

+ 4
- 1
libavcodec/adpcm.c View File

@@ -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);


Loading…
Cancel
Save