[ALSA] seq_midi_event: fix parsing of F9/FD bytes

Check for a valid event type when encoding a system real-time message to
prevent the bytes F9 or FD resulting in an empty sequencer message.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
Clemens Ladisch 2007-08-10 09:41:07 +02:00 committed by Jaroslav Kysela
parent bf8c1382c0
commit 0e75182cf3
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c,
ev->type = status_event[ST_SPECIAL + c - 0xf0].event;
ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK;
ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED;
return 1;
return ev->type != SNDRV_SEQ_EVENT_NONE;
}
spin_lock_irqsave(&dev->lock, flags);