Commit dd7b219c authored by Stefan Kost's avatar Stefan Kost

ffmpeg: don't divide by 0 when checking the framerates

Check for denom==0 first and set it to on in that case.
parent 6444bd25
......@@ -204,6 +204,10 @@ gst_ff_vid_caps_new (AVCodecContext * context, enum CodecID codec_id,
num = context->time_base.den / context->ticks_per_frame;
denom = context->time_base.num;
if (!denom) {
GST_LOG ("invalid framerate: %d/0, -> %d/1", num, num);
denom = 1;
}
if (gst_util_fraction_compare (num, denom, 1000, 1) > 0) {
GST_LOG ("excessive framerate: %d/%d, -> 0/1", num, denom);
num = 0;
......
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