From: Clemens Ladisch Date: Fri, 10 Aug 2007 07:41:07 +0000 (+0200) Subject: [ALSA] seq_midi_event: fix parsing of F9/FD bytes X-Git-Tag: v2.6.24-rc1~832^2~197 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e75182cf34ab7f7f1d88c1231fcc04780a7dc7d;p=linux-2.6 [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 Signed-off-by: Jaroslav Kysela --- diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c index a15f5e68e0..46416771c9 100644 --- a/sound/core/seq/seq_midi_event.c +++ b/sound/core/seq/seq_midi_event.c @@ -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);