aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mixer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mixer.c b/mixer.c
index 8e99fad..b6c854f 100644
--- a/mixer.c
+++ b/mixer.c
@@ -392,6 +392,11 @@ int mixer_ctl_set_value(struct mixer_ctl *ctl, unsigned int id, int value)
break;
case SNDRV_CTL_ELEM_TYPE_INTEGER:
+ if ((value < mixer_ctl_get_range_min(ctl)) ||
+ (value > mixer_ctl_get_range_max(ctl))) {
+ return -EINVAL;
+ }
+
ev.value.integer.value[id] = value;
break;