Commit ddbc5768 authored by David Reid's avatar David Reid

ALSA: Fix a potential crash on older versions of Linux.

Public issue https://github.com/mackron/miniaudio/issues/532
parent b8b3affa
......@@ -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. */
{
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) {
ma_uint32 iChannel;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment