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.
This commit is contained in:
Clemens Ladisch 2007-08-10 09:41:17 +02:00
parent 5090cf3520
commit f2835d86fa

View 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) &&