get_channel_name() was accessing the channel_name array without bounds
checking. When using more than 16 channels without a channel map, it
would read past the end of the array and crash.
Closes: https://github.com/alsa-project/alsa-utils/pull/319
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
return name ? name : "Unknown";
}
#endif
- return gettext(channel_name[chn]);
+ if (chn < MAX_CHANNELS)
+ return gettext(channel_name[chn]);
+ return "Unknown";
}
static const int supported_formats[] = {