]> git.alsa-project.org Git - alsa-lib.git/commitdiff
rawmidi: fix the params_mode check condition in snd_rawmidi_tread()
authorJaroslav Kysela <perex@perex.cz>
Sun, 26 Jun 2022 14:07:56 +0000 (16:07 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 26 Jun 2022 14:07:56 +0000 (16:07 +0200)
The condition should be obviously reversed.

Reported-by: Mark ZurSchmiede <zursch@gmail.com>
Fixes: 5ac61983 ("rawmidi: allow timestamp reads only for the appropriate read mode")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/rawmidi/rawmidi.c

index 2ff3f6cfbdbe3e920b68a81f2839edccb1658d31..570e06755456a7c8a624c5a79ae39e72373334a6 100644 (file)
@@ -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;