From 592fb2b9133a5cccb2920894392a3fd341751827 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 18 Feb 2012 12:39:17 -0800 Subject: Make sure an ALSA capture device was found before accessing the map --- Alc/backends/alsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- cgit v1.2.3