From: Edward Hervey Date: Sat, 5 Apr 2014 09:37:53 +0000 (+0200) Subject: gstvalue: Prevent division or modulo by zero X-Git-Tag: 1.3.1~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b51e9dc60fcba2bf4a1c6cdaaffb562d2e7e6d3;p=platform%2Fupstream%2Fgstreamer.git gstvalue: Prevent division or modulo by zero The step can end up being zero if the underlying value isn't a valid range GValue. In those cases, return FALSE. We don't use g_return*_if_fail since it will already have been triggered by the above-mentionned _get_step() functions. CID #1037132 --- diff --git a/gst/gstvalue.c b/gst/gstvalue.c index f45597f..6643080 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -4445,6 +4445,8 @@ gst_value_list_equals_range (const GValue * list, const GValue * value) const gint64 rmax = gst_value_get_int64_range_max (value); const gint64 rstep = gst_value_get_int64_range_step (value); GST_DEBUG ("List/range of int64s"); + if (rstep == 0) + return FALSE; if (list_size != rmax / rstep - rmin / rstep + 1) return FALSE; for (n = 0; n < list_size; ++n) {