summaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-02-18 12:39:17 -0800
committerChris Robinson <[email protected]>2012-02-18 12:39:17 -0800
commit592fb2b9133a5cccb2920894392a3fd341751827 (patch)
tree8487868d440a17ffba4fc574b19b2feef0914468 /Alc/backends
parentf68f3f5f8656648807891ca704a888c3b28a0f33 (diff)
Make sure an ALSA capture device was found before accessing the map
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/alsa.c2
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
{