[FFmpeg-cvslog] avformat/avidec: Use 64bit in get_duration()

Michael Niedermayer git at videolan.org
Sat Feb 20 22:10:48 EET 2021


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jan 31 16:30:59 2021 +0100| [fc22600d5c59b196b4d577d4dc4c675ab5f95b48] | committer: Michael Niedermayer

avformat/avidec: Use 64bit in get_duration()

Fixes: signed integer overflow: 2147483424 + 8224 cannot be represented in type 'int'
Fixes: 29619/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5191424373030912

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

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

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

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 356a39ddc7..0d66ad2311 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -125,7 +125,7 @@ static inline int get_duration(AVIStream *ast, int len)
     if (ast->sample_size)
         return len;
     else if (ast->dshow_block_align)
-        return (len + ast->dshow_block_align - 1) / ast->dshow_block_align;
+        return (len + (int64_t)ast->dshow_block_align - 1) / ast->dshow_block_align;
     else
         return 1;
 }



More information about the ffmpeg-cvslog mailing list