ffmpeg | branch: release/4.3 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun Jun 16 23:42:37 2024 +0200| [0258d8302d6c21a7087f90bed0ced93db65304ad] | 
committer: Michael Niedermayer

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 <mich...@niedermayer.cc>
(cherry picked from commit d34d4b6a7ce7fa72239c47d22ab6592d0687ac86)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0258d8302d6c21a7087f90bed0ced93db65304ad
---

 libavcodec/r210enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index be1943f5f9..e5e0e775c5 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -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;
 }

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to