mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
PulseAudio: Fix a crash if the requested channel count is too high.
This commit is contained in:
+10
@@ -31890,6 +31890,11 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
|
||||
ss.channels = pDescriptorCapture->channels;
|
||||
}
|
||||
|
||||
/* PulseAudio has a maximum channel count of 32. We'll get a crash if this is exceeded. */
|
||||
if (ss.channels > 32) {
|
||||
ss.channels = 32;
|
||||
}
|
||||
|
||||
/* Use a default channel map. */
|
||||
((ma_pa_channel_map_init_extend_proc)pDevice->pContext->pulse.pa_channel_map_init_extend)(&cmap, ss.channels, pConfig->pulse.channelMap);
|
||||
|
||||
@@ -32042,6 +32047,11 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
|
||||
ss.channels = pDescriptorPlayback->channels;
|
||||
}
|
||||
|
||||
/* PulseAudio has a maximum channel count of 32. We'll get a crash if this is exceeded. */
|
||||
if (ss.channels > 32) {
|
||||
ss.channels = 32;
|
||||
}
|
||||
|
||||
/* Use a default channel map. */
|
||||
((ma_pa_channel_map_init_extend_proc)pDevice->pContext->pulse.pa_channel_map_init_extend)(&cmap, ss.channels, pConfig->pulse.channelMap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user