diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index d0f25d82ad..0a3b2cd78b 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -561,7 +561,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter, if (!ist->framerate.num) { AVRational codec_fr = av_inv_q(ist->st->codec->time_base); codec_fr.den *= ist->st->codec->ticks_per_frame; - if(av_q2d(codec_fr) < av_q2d(fr)*0.7) + if(codec_fr.num>0 && codec_fr.den>0 && av_q2d(codec_fr) < av_q2d(fr)*0.7) fr = codec_fr; }