From: Jaroslav Kysela Date: Sun, 26 Jun 2022 14:07:56 +0000 (+0200) Subject: rawmidi: fix the params_mode check condition in snd_rawmidi_tread() X-Git-Tag: v1.2.7.2~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=917f4124840ab95324af9fdff05d787c1c677400;p=alsa-lib.git rawmidi: fix the params_mode check condition in snd_rawmidi_tread() The condition should be obviously reversed. Reported-by: Mark ZurSchmiede Fixes: 5ac61983 ("rawmidi: allow timestamp reads only for the appropriate read mode") Signed-off-by: Jaroslav Kysela --- diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c index 2ff3f6cf..570e0675 100644 --- a/src/rawmidi/rawmidi.c +++ b/src/rawmidi/rawmidi.c @@ -1114,7 +1114,7 @@ ssize_t snd_rawmidi_tread(snd_rawmidi_t *rawmidi, struct timespec *tstamp, void assert(rawmidi); assert(rawmidi->stream == SND_RAWMIDI_STREAM_INPUT); assert(buffer || size == 0); - if ((rawmidi->params_mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) == SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP) + if ((rawmidi->params_mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) != SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP) return -EINVAL; if (rawmidi->ops->tread == NULL) return -ENOTSUP;