diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-05 19:52:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:46 +0100 |
commit | e02dedf2670c380011f52b6243bf0a3a88906576 (patch) | |
tree | 8084f3ef751ccee41030370336fc4eb373641b2b | |
parent | 09e942aa4d597a75a3c510bf96583302ae707f30 (diff) | |
download | ffmpeg-e02dedf2670c380011f52b6243bf0a3a88906576.tar.gz |
avcodec/takdec: Fix overflow with large sample rates
Fixes: signed integer overflow: 2147483647 + 511 cannot be represented in type 'int'
Fixes: 17899/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5719753322135552
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 42eb78059d149abcd994f46c8b8a0dd98e86b594)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/takdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 4fb5825532..8ec87ab509 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -176,8 +176,8 @@ static void set_sample_rate_params(AVCodecContext *avctx) } else { shift = 0; } - s->uval = FFALIGN(avctx->sample_rate + 511 >> 9, 4) << shift; - s->subframe_scale = FFALIGN(avctx->sample_rate + 511 >> 9, 4) << 1; + s->uval = FFALIGN(avctx->sample_rate + 511LL >> 9, 4) << shift; + s->subframe_scale = FFALIGN(avctx->sample_rate + 511LL >> 9, 4) << 1; } static av_cold int tak_decode_init(AVCodecContext *avctx) |