aboutsummaryrefslogtreecommitdiff
path: root/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixer.c')
-rw-r--r--mixer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mixer.c b/mixer.c
index 4568cca..8e99fad 100644
--- a/mixer.c
+++ b/mixer.c
@@ -383,6 +383,9 @@ int mixer_ctl_set_value(struct mixer_ctl *ctl, unsigned int id, int value)
if (ret < 0)
return ret;
+ if (value > mixer_ctl_get_range_max(ctl))
+ value = mixer_ctl_get_range_max(ctl);
+
switch (ctl->info->type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
ev.value.integer.value[id] = !!value;