|
@@ -285,7 +285,12 @@ local_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev
|
|
|
static int
|
|
|
note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev)
|
|
|
{
|
|
|
- struct seq_oss_synthinfo *info = &dp->synths[dev];
|
|
|
+ struct seq_oss_synthinfo *info;
|
|
|
+
|
|
|
+ if (!snd_seq_oss_synth_is_valid(dp, dev))
|
|
|
+ return -ENXIO;
|
|
|
+
|
|
|
+ info = &dp->synths[dev];
|
|
|
switch (info->arg.event_passing) {
|
|
|
case SNDRV_SEQ_OSS_PROCESS_EVENTS:
|
|
|
if (! info->ch || ch < 0 || ch >= info->nr_voices) {
|
|
@@ -340,7 +345,12 @@ note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, st
|
|
|
static int
|
|
|
note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev)
|
|
|
{
|
|
|
- struct seq_oss_synthinfo *info = &dp->synths[dev];
|
|
|
+ struct seq_oss_synthinfo *info;
|
|
|
+
|
|
|
+ if (!snd_seq_oss_synth_is_valid(dp, dev))
|
|
|
+ return -ENXIO;
|
|
|
+
|
|
|
+ info = &dp->synths[dev];
|
|
|
switch (info->arg.event_passing) {
|
|
|
case SNDRV_SEQ_OSS_PROCESS_EVENTS:
|
|
|
if (! info->ch || ch < 0 || ch >= info->nr_voices) {
|