Commit 547ec4d3 authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: check timebase validity before using it.

Found-by: Daemon404
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent af32a1f2
......@@ -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;
}
......
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