aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
{