Skip to content

Commit

Permalink
[ALSA] seq_midi_event: fix parsing of F9/FD bytes
Browse files Browse the repository at this point in the history
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.

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 bf8c138 commit 0e75182
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/seq/seq_midi_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c,
ev->type = status_event[ST_SPECIAL + c - 0xf0].event;
ev->flags &= ~SNDRV_SEQ_EVENT_LENGTH_MASK;
ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED;
return 1;
return ev->type != SNDRV_SEQ_EVENT_NONE;
}

spin_lock_irqsave(&dev->lock, flags);
Expand Down

0 comments on commit 0e75182

Please sign in to comment.