]> git.alsa-project.org Git - alsa-lib.git/commitdiff
topology: Fix variable overflow in split_format
authorMarcin Pietraszko <marcin.pietraszko@linux.intel.com>
Mon, 26 Aug 2019 11:51:41 +0000 (13:51 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 27 Aug 2019 07:37:32 +0000 (09:37 +0200)
The 1 which was 32-bit long, when left-shifted by more than 31 caused
an overflow, which resulted in some of the formats being not supported.

Signed-off-by: Marcin Pietraszko <marcin.pietraszko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/topology/pcm.c

index c533ee68506177ec7afda80345a41233236256b0..553fd822031b8c9de82a3f591f77f24ce5841f3f 100644 (file)
@@ -321,7 +321,7 @@ static int split_format(struct snd_soc_tplg_stream_caps *caps, char *str)
                        return -EINVAL;
                }
 
-               caps->formats |= 1 << format;
+               caps->formats |= 1ull << format;
                s = strtok(NULL, ", ");
                i++;
        }