diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-06-16 23:42:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-06-26 20:49:35 +0200 |
commit | d34d4b6a7ce7fa72239c47d22ab6592d0687ac86 (patch) | |
tree | 7ad30806e2218676cb0be7bbfe3685552e4b025e /libavcodec/r210enc.c | |
parent | 228f255b5d9b839149cd53f0537ce76b068228ae (diff) | |
download | ffmpeg-d34d4b6a7ce7fa72239c47d22ab6592d0687ac86.tar.gz |
avcodec/r210enc: Use av_rescale for bitrate
Fixes: signed integer overflow: 281612954574848 * 65344 cannot be represented in type 'long'
Fixes: 68956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_R210_fuzzer-6459074458746880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/r210enc.c')
-rw-r--r-- | libavcodec/r210enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index 91e3452874..ec1ebc8d60 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -35,7 +35,7 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->bits_per_coded_sample = 32; if (avctx->width > 0) - avctx->bit_rate = ff_guess_coded_bitrate(avctx) * aligned_width / avctx->width; + avctx->bit_rate = av_rescale(ff_guess_coded_bitrate(avctx), aligned_width, avctx->width); return 0; } |