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>
(cherry picked from commit d34d4b6a7c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-16 23:42:37 +02:00
parent b5aa25d9d4
commit 7b45312ef3
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,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;
}