aseqdump: Check the -u option value properly

Instead of passing the value as is, check the value passed to -u
option and bail out for bad values.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2024-07-22 17:29:12 +02:00
parent 946ea467cf
commit 397c198955

View file

@ -1086,6 +1086,8 @@ int main(int argc, char *argv[])
break; break;
case 'u': case 'u':
ump_version = atoi(optarg); ump_version = atoi(optarg);
if (ump_version < 0 || ump_version > 2)
fatal("Invalid UMP version %d", ump_version);
snd_seq_set_client_midi_version(seq, ump_version); snd_seq_set_client_midi_version(seq, ump_version);
break; break;
case 'r': case 'r':