mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
alsa-util: don't crash on devices with more than 32 channels
The pa_channel_map_init_extend() call later in the function crashes if if ss->channels is greater than PA_CHANNELS_MAX. Reported here: https://lists.freedesktop.org/archives/pulseaudio-discuss/2017-January/027404.html Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
parent
539371b3f7
commit
ca6c3f80f5
1 changed files with 7 additions and 0 deletions
|
|
@ -747,6 +747,13 @@ snd_pcm_t *pa_alsa_open_by_device_string(
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (ss->channels > PA_CHANNELS_MAX) {
|
||||
pa_log("Device %s has %u channels, but PulseAudio supports only %u channels. Unable to use the device.",
|
||||
d, ss->channels, PA_CHANNELS_MAX);
|
||||
snd_pcm_close(pcm_handle);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (dev)
|
||||
*dev = d;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue