OSDN Git Service

test/chmap: Fix wrong malloc size
authorTakashi Iwai <tiwai@suse.de>
Thu, 13 Sep 2012 06:06:26 +0000 (08:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 13 Sep 2012 06:24:59 +0000 (08:24 +0200)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
test/chmap.c

index a566b1c..d73ae73 100644 (file)
@@ -118,7 +118,7 @@ static int set_chmap(snd_pcm_t *pcm, int format, int channels, int rate,
        }
        if (setup_pcm(pcm, format, channels, rate))
                return 1;
-       map = malloc(sizeof(int) * channels + 1);
+       map = malloc(sizeof(int) * (channels + 1));
        if (!map) {
                printf("cannot malloc\n");
                return 1;