vc1parse: Avoid division by zero assertion

A framerate of 0/1 is valid, but we cannot calculate the frame duration
in this context. Simply protect against this case.

Related to #660
This commit is contained in:
Nicolas Dufresne 2019-07-12 20:39:45 -04:00
parent a5113fe8c8
commit 44322b1dfc

View file

@ -891,6 +891,7 @@ gst_vc1_parse_update_caps (GstVC1Parse * vc1parse)
gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, vc1parse->fps_n, gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, vc1parse->fps_n,
vc1parse->fps_d, NULL); vc1parse->fps_d, NULL);
if (vc1parse->fps_n > 0)
vc1parse->frame_duration = gst_util_uint64_scale (GST_SECOND, vc1parse->frame_duration = gst_util_uint64_scale (GST_SECOND,
vc1parse->fps_d, vc1parse->fps_n); vc1parse->fps_d, vc1parse->fps_n);
} }