OSDN Git Service

ffmpeg: check timebase validity before using it.
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Oct 2012 18:35:01 +0000 (20:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Oct 2012 18:35:45 +0000 (20:35 +0200)
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_filter.c

index d0f25d8..0a3b2cd 100644 (file)
@@ -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;
     }