aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-02-01 19:55:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-11 21:23:49 +0200
commite9871b10a9f0f38d227147fa90e2b95fbcbe4bab (patch)
treef4bd51b69efd672911db2c68488926411b09d55f /libavcodec/utils.c
parent5e01c257411364511a5259d51a21fec0ffbe7575 (diff)
downloadffmpeg-e9871b10a9f0f38d227147fa90e2b95fbcbe4bab.tar.gz
avcodec/utils: Use more bits for intermediate for AV_CODEC_ID_ADPCM_MS
Fixes: signed integer overflow: 1172577312 * 2 cannot be represented in type 'int' Fixes: 29924/clusterfuzz-testcase-minimized-ffmpeg_dem_BOA_fuzzer-4882912874594304 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 0f441b9063281d8ef5d4c30b10379d08aad8924f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bb352c6597..55644a9b61 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1869,7 +1869,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
case AV_CODEC_ID_ADPCM_IMA_RAD:
return blocks * ((ba - 4 * ch) * 2 / ch);
case AV_CODEC_ID_ADPCM_MS:
- return blocks * (2 + (ba - 7 * ch) * 2 / ch);
+ return blocks * (2 + (ba - 7 * ch) * 2LL / ch);
case AV_CODEC_ID_ADPCM_MTAF:
return blocks * (ba - 16) * 2 / ch;
}