diff options
author | Simon Wilson <simonwilson@google.com> | 2014-05-07 06:35:42 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2014-05-07 06:35:42 -0700 |
commit | 25e5e789c50105c1eca5bcfd37aa00327817fe45 (patch) | |
tree | 1797c95168f108d3cf779ddc9427515932b666bb | |
parent | c73afc593d6b714c82813b943f69067fb4fa4234 (diff) | |
parent | 6cd7d5f9870ef548bcb5a941061eeed9ad6b0d16 (diff) |
Merge pull request #40 from dawagner/check-mixer-input-value
Mixer: Check validity of input value
-rw-r--r-- | mixer.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |