mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
ffmpeg: don't divide by 0 when checking the framerates
Check for denom==0 first and set it to on in that case.
This commit is contained in:
parent
6444bd2557
commit
dd7b219c42
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue