]> git.alsa-project.org Git - alsa-lib.git/commitdiff
rawmidi_hw: add sanity check for the invalid stream arguments (coverity)
authorJaroslav Kysela <perex@perex.cz>
Fri, 24 May 2019 18:45:26 +0000 (20:45 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 24 May 2019 19:25:50 +0000 (21:25 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/rawmidi/rawmidi_hw.c

index 7cc8c0d1e7ecd0242317b7123bfed2e20e5d7a03..eaa8a76de52f800bf00eb093da132a916241f26a 100644 (file)
@@ -186,6 +186,8 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
                *inputp = NULL;
        if (outputp)
                *outputp = NULL;
+       if (!inputp && !outputp)
+               return -EINVAL;
        
        if ((ret = snd_ctl_hw_open(&ctl, NULL, card, 0)) < 0)
                return ret;