Commit e8f814a9 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/utils: Fix division by 0

Fixes: signal_sigsegv_14999ef_1188_cov_2888512890_SVA_CL1_E.264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 238247b6
...@@ -4190,8 +4190,8 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f ...@@ -4190,8 +4190,8 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f
if (st->codec->ticks_per_frame > 1) { if (st->codec->ticks_per_frame > 1) {
if ( codec_fr.num > 0 && codec_fr.den > 0 && av_q2d(codec_fr) < av_q2d(fr)*0.7 if ( codec_fr.num > 0 && codec_fr.den > 0 &&
&& fabs(1.0 - av_q2d(av_div_q(avg_fr, fr))) > 0.1) (fr.num == 0 || av_q2d(codec_fr) < av_q2d(fr)*0.7 && fabs(1.0 - av_q2d(av_div_q(avg_fr, fr))) > 0.1))
fr = codec_fr; 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