aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/asfdec_f.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-09-12 19:44:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commitbe04f6dfa31f5462959a873b81aab43469992507 (patch)
tree2e85d2bd42e0a0934fa3c21d8a9ff1eced83f443 /libavformat/asfdec_f.c
parent3631f0932660ca530187f660158f32efb861c1a0 (diff)
downloadffmpeg-be04f6dfa31f5462959a873b81aab43469992507.tar.gz
avformat/asfdec_f: Change order or operations slightly
Fixes: signed integer overflow: 20 * 5184056935931942919 cannot be represented in type 'long' Fixes: 25466/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4798660247552000 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 686f0151901849de3b2073fa73265472073e0208) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/asfdec_f.c')
-rw-r--r--libavformat/asfdec_f.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index ef6b618a5a..7d248c7af3 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -422,7 +422,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
if (!(asf->hdr.flags & 0x01)) { // if we aren't streaming...
int64_t fsize = avio_size(pb);
if (fsize <= 0 || (int64_t)asf->hdr.file_size <= 0 ||
- 20*FFABS(fsize - (int64_t)asf->hdr.file_size) < FFMIN(fsize, asf->hdr.file_size))
+ FFABS(fsize - (int64_t)asf->hdr.file_size) < FFMIN(fsize, asf->hdr.file_size)/20)
st->duration = asf->hdr.play_time /
(10000000 / 1000) - start_time;
}