mirror of
https://github.com/ericonr/sndio.git
synced 2024-02-18 04:45:21 -06:00
fix max ctl value check
This commit is contained in:
parent
ee10431307
commit
ebefac2a1e
@ -2117,8 +2117,15 @@ dev_setctl(struct dev *d, int addr, int val)
|
||||
struct ctl *c;
|
||||
int num;
|
||||
|
||||
if (val < 0 || val >= MIDI_MAXCTL)
|
||||
if (val < 0 || val > MIDI_MAXCTL) {
|
||||
if (log_level >= 3) {
|
||||
dev_log(d);
|
||||
log_puts(": ");
|
||||
log_putu(val);
|
||||
log_puts(": ctl val out of bounds\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
c = d->ctl_list;
|
||||
for (;;) {
|
||||
if (c == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user