mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
ALSA: Fix a potential crash on older versions of Linux.
Public issue https://github.com/mackron/miniaudio/issues/532
This commit is contained in:
+5
-1
@@ -26626,7 +26626,11 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic
|
|||||||
|
|
||||||
/* Grab the internal channel map. For now we're not going to bother trying to change the channel map and instead just do it ourselves. */
|
/* Grab the internal channel map. For now we're not going to bother trying to change the channel map and instead just do it ourselves. */
|
||||||
{
|
{
|
||||||
ma_snd_pcm_chmap_t* pChmap = ((ma_snd_pcm_get_chmap_proc)pDevice->pContext->alsa.snd_pcm_get_chmap)(pPCM);
|
ma_snd_pcm_chmap_t* pChmap = NULL;
|
||||||
|
if (pDevice->pContext->alsa.snd_pcm_get_chmap != NULL) {
|
||||||
|
pChmap = ((ma_snd_pcm_get_chmap_proc)pDevice->pContext->alsa.snd_pcm_get_chmap)(pPCM);
|
||||||
|
}
|
||||||
|
|
||||||
if (pChmap != NULL) {
|
if (pChmap != NULL) {
|
||||||
ma_uint32 iChannel;
|
ma_uint32 iChannel;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user