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.
This commit is contained in:
Edward Hervey 2013-12-10 17:09:07 -05:00
parent 9a62f007fc
commit b363ab17e7

View file

@ -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;
}