From b363ab17e7a34fb1040481b9aadabf2ad6c93901 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 10 Dec 2013 17:09:07 -0500 Subject: [PATCH] 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. --- libs/gst/controller/gstinterpolationcontrolsource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gst/controller/gstinterpolationcontrolsource.c b/libs/gst/controller/gstinterpolationcontrolsource.c index 0aea6cd841..b8a3c223c8 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; } -- 2.34.1