diff options
author | Chris Robinson <[email protected]> | 2012-02-18 12:39:17 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-02-18 12:39:17 -0800 |
commit | 592fb2b9133a5cccb2920894392a3fd341751827 (patch) | |
tree | 8487868d440a17ffba4fc574b19b2feef0914468 | |
parent | f68f3f5f8656648807891ca704a888c3b28a0f33 (diff) |
Make sure an ALSA capture device was found before accessing the map
-rw-r--r-- | Alc/backends/alsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index e99942be..51579750 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -844,7 +844,7 @@ static ALCenum alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceName) if(!allCaptureDevNameMap) allCaptureDevNameMap = probe_devices(SND_PCM_STREAM_CAPTURE, &numCaptureDevNames); - if(!deviceName) + if(!deviceName && numCaptureDevNames > 0) deviceName = allCaptureDevNameMap[0].name; else { |