Skip to content

Commit

Permalink
[ALSA] seq_midi_event: prevent running status after system messages
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
cladisch authored and perexg committed Oct 16, 2007
1 parent 394d051 commit 0b664f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/core/seq/seq_midi_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit 0b664f7

Please sign in to comment.