diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-27 17:21:19 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-09 22:02:19 +0200 |
commit | 4ecce5f2562a4be683b9321f385b6ac57f48f5a8 (patch) | |
tree | abc4f87457526a15945132983dc5c506729a4cd4 /libavcodec | |
parent | 8206115257cba5af70357a44527b65377e22ccb7 (diff) | |
download | ffmpeg-4ecce5f2562a4be683b9321f385b6ac57f48f5a8.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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c8f4ff7973..bc406282f7 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3620,8 +3620,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; + } } } |