mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-06 06:46:29 -04:00
acp: handle channel map allocation errors
This commit is contained in:
parent
7bfc820ae8
commit
24f9b9a335
1 changed files with 4 additions and 1 deletions
|
|
@ -227,7 +227,8 @@ static void init_device(pa_card *impl, pa_alsa_device *dev, pa_alsa_direction_t
|
|||
dev->device.format.rate_mask = m->sample_spec.rate;
|
||||
dev->device.format.channels = m->channel_map.channels;
|
||||
dev->device.format.map = calloc(m->channel_map.channels, sizeof(uint32_t));
|
||||
channelmap_to_acp(&m->channel_map, dev->device.format.map);
|
||||
if (dev->device.format.map != NULL)
|
||||
channelmap_to_acp(&m->channel_map, dev->device.format.map);
|
||||
pa_cvolume_reset(&dev->real_volume, dev->device.format.channels);
|
||||
pa_cvolume_reset(&dev->soft_volume, dev->device.format.channels);
|
||||
dev->direction = direction;
|
||||
|
|
@ -1744,6 +1745,8 @@ static int device_enable(pa_card *impl, pa_alsa_mapping *mapping, pa_alsa_device
|
|||
dev->device.format.channels = atoi(channels);
|
||||
free(dev->device.format.map);
|
||||
dev->device.format.map = calloc(dev->device.format.channels, sizeof(uint32_t));
|
||||
if (dev->device.format.map == NULL)
|
||||
break;
|
||||
|
||||
while ((position = pa_split_in_place(positions, ",", &n, &split_state)) != NULL &&
|
||||
i < dev->device.format.channels) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue