[ALSA] seq_midi_event: fix parsing of F9/FD bytes
authorClemens Ladisch <clemens@ladisch.de>
Fri, 10 Aug 2007 07:41:07 +0000 (09:41 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 13:58:38 +0000 (15:58 +0200)
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>
sound/core/seq/seq_midi_event.c

index a15f5e68e0b62119e976956b7b9d3c565782c489..46416771c9b3426715ca06331a8543d9d859ffa8 100644 (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);