From 0b664f7206fac9676559e0012d8accc2dc0fc9fd Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Fri, 10 Aug 2007 09:39:14 +0200 Subject: [ALSA] seq_midi_event: prevent running status after system messages Reset the event type after encoding a system message to prevent any following data bytes from being interpreted as data for a running status system message, which is not allowed in MIDI. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- sound/core/seq/seq_midi_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c index cb38ff3..45ba6fc 100644 --- a/sound/core/seq/seq_midi_event.c +++ b/sound/core/seq/seq_midi_event.c @@ -283,6 +283,8 @@ int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c, ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED; if (status_event[dev->type].encode) /* set data values */ status_event[dev->type].encode(dev, ev); + if (dev->type >= ST_SPECIAL) + dev->type = ST_INVALID; rc = 1; } else if (dev->type == ST_SYSEX) { if (c == MIDI_CMD_COMMON_SYSEX_END || -- cgit v1.1