From: Piotr Maziarz Date: Mon, 31 Aug 2020 09:08:56 +0000 (+0200) Subject: topology: decode: Remove decoding values for enum control X-Git-Tag: v1.2.4~32 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=11d4a5aa721dce2c3f7430996caf244a73dd5099;p=alsa-lib.git topology: decode: Remove decoding values for enum control Values have no representation in standard ALSA configuration files, therefore there is no need to populate them. Also memory for values wasn't allocated which was causing undefined behaviour. Signed-off-by: Piotr Maziarz Reviewed-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Signed-off-by: Jaroslav Kysela --- diff --git a/src/topology/ctl.c b/src/topology/ctl.c index 0aa49ab8..02e482e7 100644 --- a/src/topology/ctl.c +++ b/src/topology/ctl.c @@ -1367,11 +1367,8 @@ int tplg_decode_control_enum1(snd_tplg_t *tplg, et->texts = tplg_calloc(heap, sizeof(char *) * ec->items); if (!et->texts) return -ENOMEM; - for (i = 0; i < ec->items; i++) { - unsigned int j = i * sizeof(int) * ENUM_VAL_SIZE; + for (i = 0; i < ec->items; i++) et->texts[i] = ec->texts[i]; - et->values[i] = (int *)&ec->values[j]; - } } et->map = tplg_calloc(heap, sizeof(struct snd_tplg_channel_map_template));