aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-29 23:23:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:11:55 +0200
commitb735adcec5ef80bde216e20552a661b1221d3899 (patch)
tree30bb28f1a245879218f6918a480e9d98249ae343
parent1da95b4bd1deae52cb94a64f55e9fd2a759750ab (diff)
downloadffmpeg-b735adcec5ef80bde216e20552a661b1221d3899.tar.gz
avformat/utils: Check timebase before use in estimate_timings()
Fixes: division by 0 Fixes: 15480/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5746727434321920 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 f57e97dfd9539bc3f4f97a76ebc001f0b055cb88) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index dc867a96a3..8bef917b13 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2859,6 +2859,7 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
AVStream av_unused *st;
for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
+ if (st->time_base.den)
av_log(ic, AV_LOG_TRACE, "stream %d: start_time: %0.3f duration: %0.3f\n", i,
(double) st->start_time * av_q2d(st->time_base),
(double) st->duration * av_q2d(st->time_base));