aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-04-19 17:05:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-05-19 17:17:36 +0200
commit36786f54e788cdfd24e11a45d8bd5690ec37e82a (patch)
tree837f726e9c7a200b1029b765d52684d091eabd42
parent2f747b2d827612e1d4c071e6c7a1f7a748c8ef1d (diff)
downloadffmpeg-36786f54e788cdfd24e11a45d8bd5690ec37e82a.tar.gz
avcodec/binkaudio: Fix 2Ghz sample_rate
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 19950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINKAUDIO_DCT_fuzzer-5765514337189888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Suggested-by: Paul Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f603d10b1e6bb2fbf4dcccc43d3ea2fb911b36ba) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/binkaudio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 2384ebf312..fbaf925037 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -109,7 +109,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->frame_len = 1 << frame_len_bits;
s->overlap_len = s->frame_len / 16;
s->block_size = (s->frame_len - s->overlap_len) * s->channels;
- sample_rate_half = (sample_rate + 1) / 2;
+ sample_rate_half = (sample_rate + 1LL) / 2;
if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
s->root = 2.0 / (sqrt(s->frame_len) * 32768.0);
else