nvenc: Fix crash with unspecified framerate

Nvidia driver seems to calculating floating point framerate
without validation. This causes crash both on linux and Windows.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1012
This commit is contained in:
Seungha Yang 2019-07-30 23:54:48 +09:00 committed by Sebastian Dröge
parent 6c552030f7
commit 158b4d8649

View file

@ -1069,7 +1069,8 @@ gst_nv_base_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
params->frameRateNum = info->fps_n; params->frameRateNum = info->fps_n;
params->frameRateDen = info->fps_d; params->frameRateDen = info->fps_d;
} else { } else {
GST_FIXME_OBJECT (nvenc, "variable framerate"); params->frameRateNum = 0;
params->frameRateDen = 1;
} }
if (gst_util_fraction_multiply (GST_VIDEO_INFO_WIDTH (info), if (gst_util_fraction_multiply (GST_VIDEO_INFO_WIDTH (info),