Browse Source

avcodec/adpcm: Fix overflow in FFABS() IMA_EA_EACS

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 19235/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_EA_EACS_fuzzer-5680878952382464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 5 years ago
parent
commit
794352ae9d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/adpcm.c

+ 1
- 1
libavcodec/adpcm.c View File

@@ -1233,7 +1233,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
}
for (i=0; i<=st; i++) {
c->status[i].predictor = bytestream2_get_le32u(&gb);
if (FFABS(c->status[i].predictor) > (1<<16))
if (FFABS((int64_t)c->status[i].predictor) > (1<<16))
return AVERROR_INVALIDDATA;
}



Loading…
Cancel
Save