Commit 09f75b5b authored by Michael Niedermayer's avatar Michael Niedermayer

division by zero fix

Originally committed as revision 4191 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 327c4076
......@@ -1841,12 +1841,12 @@ int av_find_stream_info(AVFormatContext *ic)
if(st->codec.codec_id == CODEC_ID_RAWVIDEO && !st->codec.codec_tag && !st->codec.bits_per_sample)
st->codec.codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec.pix_fmt);
if(best_duration[i] < INT64_MAX && st->codec.time_base.num*1000 <= st->codec.time_base.den){
if(best_duration[i] < INT64_MAX && st->codec.time_base.num*1000 <= st->codec.time_base.den &&
st->time_base.num*best_duration[i]*1000LL > st->time_base.den){
int int_fps;
st->r_frame_rate.num= st->time_base.den;
st->r_frame_rate.den= st->time_base.num*best_duration[i];
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->r_frame_rate.num, st->r_frame_rate.den, 1<<15);
int_fps= av_rescale(st->r_frame_rate.num, 1, st->r_frame_rate.den); // 1/0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment