aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-27 17:21:19 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-02 14:18:21 +0100
commit4b080eaf2b437a86c3cffa37fa1a258205f9e50b (patch)
treed5fbae8daea901ec2d59658f4aec959cd90d64ae
parent7f235532346ffb66c4ed96667c3d0499eb266cf6 (diff)
downloadffmpeg-4b080eaf2b437a86c3cffa37fa1a258205f9e50b.tar.gz
avcodec/utils: Check sample rate before use for AV_CODEC_ID_BINKAUDIO_DCT in get_audio_frame_duration()
Fixes: shift exponent 95 is too large for 32-bit type 'int' Fixes: 26590/clusterfuzz-testcase-minimized-ffmpeg_dem_SMACKER_fuzzer-5120609937522688 Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ec7e0d42884b40ce93b6b5e94de5f7849310f8a0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 9ba61dca71..2e99e2fce7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1613,8 +1613,11 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
if (ch > 0) {
/* calc from sample rate and channels */
- if (id == AV_CODEC_ID_BINKAUDIO_DCT)
+ if (id == AV_CODEC_ID_BINKAUDIO_DCT) {
+ if (sr / 22050 > 22)
+ return 0;
return (480 << (sr / 22050)) / ch;
+ }
}
if (id == AV_CODEC_ID_MP3)