From b3fc09254868c8b241649bcbb9b8ba0730acc797 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Sat, 14 Jul 2007 12:42:57 +0000 Subject: [PATCH] avoid division by zero in av_find_stream_info() when no time base is set Originally committed as revision 9637 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 453ff7f..401e828 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1891,7 +1891,7 @@ int av_find_stream_info(AVFormatContext *ic) (st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/) try_decode_frame(st, pkt->data, pkt->size); - if (av_rescale_q(codec_info_duration[st->index], st->time_base, AV_TIME_BASE_Q) >= ic->max_analyze_duration) { + if (st->time_base.den > 0 && av_rescale_q(codec_info_duration[st->index], st->time_base, AV_TIME_BASE_Q) >= ic->max_analyze_duration) { break; } count++; -- 2.7.4