avcodec/utils: Fix block align overflow for ADPCM_IMA_WAV

Fixes: signed integer overflow: 529008646 * 8 cannot be represented in type 'int'
Fixes: 383379145/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6674045107503104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/391/head
Michael Niedermayer 1 month ago
parent 361d24e6d9
commit 9327093079
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/utils.c

@ -729,7 +729,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
case AV_CODEC_ID_ADPCM_IMA_WAV: case AV_CODEC_ID_ADPCM_IMA_WAV:
if (bps < 2 || bps > 5) if (bps < 2 || bps > 5)
return 0; return 0;
tmp = blocks * (1LL + (ba - 4 * ch) / (bps * ch) * 8); tmp = blocks * (1LL + (ba - 4 * ch) / (bps * ch) * 8LL);
break; break;
case AV_CODEC_ID_ADPCM_IMA_DK3: case AV_CODEC_ID_ADPCM_IMA_DK3:
tmp = blocks * (((ba - 16LL) * 2 / 3 * 4) / ch); tmp = blocks * (((ba - 16LL) * 2 / 3 * 4) / ch);

Loading…
Cancel
Save