]> git.alsa-project.org Git - alsa-lib.git/commitdiff
seq_midi_event: fix parsing of F9/FD bytes
authorClemens Ladisch <clemens@ladisch.de>
Fri, 10 Aug 2007 07:41:17 +0000 (09:41 +0200)
committerClemens Ladisch <clemens@ladisch.de>
Fri, 10 Aug 2007 07:41:17 +0000 (09:41 +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.

src/seq/seq_midi_event.c

index 9c70377e3861a97e725f850a7b0f1634cd9ef976..fd34a598fd264578ee36c3e2aa02435637de023e 100644 (file)
@@ -308,7 +308,7 @@ int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev
                ev->type = status_event[ST_SPECIAL + c - 0xf0].event;
                ev->flags &= ~SND_SEQ_EVENT_LENGTH_MASK;
                ev->flags |= SND_SEQ_EVENT_LENGTH_FIXED;
-               return 1;
+               return ev->type != SND_SEQ_EVENT_NONE;
        }
 
        if ((c & 0x80) &&