diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-01-31 16:30:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 16:04:26 +0200 |
commit | bcdcc17015ae9f254ad0208b425261484cce6db1 (patch) | |
tree | de5f557cd483a543c6bda3cb867d15406534334f | |
parent | 5dafc1edca45632243a49a3b7330384fdc53326a (diff) | |
download | ffmpeg-bcdcc17015ae9f254ad0208b425261484cce6db1.tar.gz |
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@niedermayer.cc>
(cherry picked from commit a0ceb0cdd41b56241697cd8f83e22cdb4822d2d9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/avidec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index cff1ab0dea..914e08a80e 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -126,7 +126,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; } |