aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-31 16:30:59 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-11 21:23:49 +0200
commit69ffdd28c430a8375a2b19a34987df944832c632 (patch)
treeed7001962fee0a7999629e325de15cdaf5323620
parent58b0d89f959ef4016000ba8582212e638b667756 (diff)
downloadffmpeg-69ffdd28c430a8375a2b19a34987df944832c632.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index c8f1f63ca6..9e71dcfc6f 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;
}