aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-09-02 23:13:00 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:19 +0200
commit83c2bd1a4a371ab6e02783d39cc1014bd837f739 (patch)
treed0ee10ffd68c82d3c3f59500ed78d97922214e36 /libavformat
parent640964687f1d927729cfc8691ca51eb3eb8a863e (diff)
downloadffmpeg-83c2bd1a4a371ab6e02783d39cc1014bd837f739.tar.gz
avformat/dxa: Use av_rescale() for duration computation
Fixes: signed integer overflow: 8224000000 * 1629552639 cannot be represented in type 'long' Fixes: 24908/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4658478506049536 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 c313089fbe1df71b5406dd9d7e4d36361051c620) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dxa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/dxa.c b/libavformat/dxa.c
index 162838c135..4f314b6d10 100644
--- a/libavformat/dxa.c
+++ b/libavformat/dxa.c
@@ -143,7 +143,7 @@ static int dxa_read_header(AVFormatContext *s)
c->readvid = !c->has_sound;
c->vidpos = avio_tell(pb);
s->start_time = 0;
- s->duration = (int64_t)c->frames * AV_TIME_BASE * num / den;
+ s->duration = av_rescale(c->frames, AV_TIME_BASE * (int64_t)num, den);
av_log(s, AV_LOG_DEBUG, "%d frame(s)\n",c->frames);
return 0;