From: Edward Hervey Date: Tue, 10 Dec 2013 22:09:07 +0000 (-0500) Subject: controller: Fix out-of-bounds detection X-Git-Tag: 1.3.1~284 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b363ab17e7a34fb1040481b9aadabf2ad6c93901;p=platform%2Fupstream%2Fgstreamer.git controller: Fix out-of-bounds detection We want to abort if we higher than the maximum *OR* lower than the minimum accepted value. Detected by Coverity. --- diff --git a/libs/gst/controller/gstinterpolationcontrolsource.c b/libs/gst/controller/gstinterpolationcontrolsource.c index 0aea6cd..b8a3c22 100644 --- a/libs/gst/controller/gstinterpolationcontrolsource.c +++ b/libs/gst/controller/gstinterpolationcontrolsource.c @@ -524,7 +524,7 @@ static gboolean { GstControlSource *csource = GST_CONTROL_SOURCE (self); - if (mode >= num_interpolation_modes && (int) mode < 0) { + if (mode >= num_interpolation_modes || (int) mode < 0) { GST_WARNING ("interpolation mode %d invalid or not implemented yet", mode); return FALSE; }