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,8 +891,9 @@ gst_vc1_parse_update_caps (GstVC1Parse * vc1parse)
gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, vc1parse->fps_n,
vc1parse->fps_d, NULL);
vc1parse->frame_duration = gst_util_uint64_scale (GST_SECOND,
vc1parse->fps_d, vc1parse->fps_n);
if (vc1parse->fps_n > 0)
vc1parse->frame_duration = gst_util_uint64_scale (GST_SECOND,
vc1parse->fps_d, vc1parse->fps_n);
}
if (vc1parse->par_n != 0 && vc1parse->par_d != 0)