From: Clemens Ladisch Date: Fri, 10 Aug 2007 07:41:17 +0000 (+0200) Subject: seq_midi_event: fix parsing of F9/FD bytes X-Git-Tag: v1.0.15rc1~10 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=f2835d86fab3372a9d7cb976cbdaa2569966fd60;p=alsa-lib.git 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. --- diff --git a/src/seq/seq_midi_event.c b/src/seq/seq_midi_event.c index 9c70377e..fd34a598 100644 --- a/src/seq/seq_midi_event.c +++ b/src/seq/seq_midi_event.c @@ -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) &&