[FFmpeg-cvslog] avformat/utils: Use 64bit earlier in r_frame_rate check

Michael Niedermayer git at videolan.org
Thu May 13 00:03:55 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Apr 12 22:33:06 2021 +0200| [578633fc1ac8c02a36a706bd71f775550412d1e1] | committer: Michael Niedermayer

avformat/utils: Use 64bit earlier in r_frame_rate check

Fixes: signed integer overflow: 1406796319 * 2 cannot be represented in type 'int'
Fixes: 32777/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5632576913014784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9228313a00..492e08562e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3988,7 +3988,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
 
             if (!st->r_frame_rate.num) {
                 if (    avctx->time_base.den * (int64_t) st->time_base.num
-                    <= avctx->time_base.num * avctx->ticks_per_frame * (uint64_t) st->time_base.den) {
+                    <= avctx->time_base.num * (uint64_t)avctx->ticks_per_frame * st->time_base.den) {
                     av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
                               avctx->time_base.den, (int64_t)avctx->time_base.num * avctx->ticks_per_frame, INT_MAX);
                 } else {



More information about the ffmpeg-cvslog mailing list