From: Per x Johansson Date: Tue, 11 Mar 2014 13:56:30 +0000 (+0100) Subject: matroskademux: fix assert on fps lower than 1 X-Git-Tag: 1.19.3~509^2~4757 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a362c6fb1dc4b734af57d060cd7d612b6237f91;p=platform%2Fupstream%2Fgstreamer.git matroskademux: fix assert on fps lower than 1 Fixes assert caused by gst_duration_to_fraction calling gst_util_uint64_scale_int with a denominator of 0 when fps is less than 1. https://bugzilla.gnome.org/show_bug.cgi?id=726106 --- diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index b6000b8..bdd10f6 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -4787,9 +4787,11 @@ gst_duration_to_fraction (guint64 duration, gint * dest_n, gint * dest_d) for (i = 0; i < G_N_ELEMENTS (common_den); i++) { d = common_den[i]; n = floor (0.5 + (d * 1e9) / duration); - a = gst_util_uint64_scale_int (1000000000, d, n); - if (duration >= a - 2 && duration <= a + 2) { - goto out; + if (n > 0) { + a = gst_util_uint64_scale_int (1000000000, d, n); + if (duration >= a - 2 && duration <= a + 2) { + goto out; + } } }