[FFmpeg-cvslog] avformat/utils: Check timebase before use in estimate_timings()

Michael Niedermayer git at videolan.org
Mon Jul 8 14:10:00 EEST 2019


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun 29 23:23:25 2019 +0200| [a1416c6c8d1234a53b7e52f45d7f5d613ff8cf10] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit f57e97dfd9539bc3f4f97a76ebc001f0b055cb88)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1416c6c8d1234a53b7e52f45d7f5d613ff8cf10
---

 libavformat/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 93e588ee1e..8e53bf01c7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2953,6 +2953,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));



More information about the ffmpeg-cvslog mailing list