diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-09 21:14:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-09 21:15:27 +0100 |
commit | e8f814a907036e43f755f35e885bfadf94c4d63b (patch) | |
tree | f5e7b77c1c3f962f0dd5cf8fb401377aaf76126c /libavformat | |
parent | 238247b622912019243b7abcd016cc4a0f5d3b6d (diff) | |
download | ffmpeg-e8f814a907036e43f755f35e885bfadf94c4d63b.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index bbee059f4a..aa96d15674 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4190,8 +4190,8 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f 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 - && fabs(1.0 - av_q2d(av_div_q(avg_fr, fr))) > 0.1) + if ( codec_fr.num > 0 && codec_fr.den > 0 && + (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; } |