From 711f0a29ecfca285296e0691fc8032cf0041c964 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 19 Aug 2011 02:55:36 -0700 Subject: Make sure there's a valid backend before trying to open a device --- Alc/ALc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index 6916f970..95541c8a 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -1635,6 +1635,12 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, DO_INITCONFIG(); + if(!CaptureBackend.name) + { + alcSetError(NULL, ALC_INVALID_VALUE); + return NULL; + } + if(SampleSize <= 0) { alcSetError(NULL, ALC_INVALID_VALUE); @@ -2690,6 +2696,12 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) DO_INITCONFIG(); + if(!PlaybackBackend.name) + { + alcSetError(NULL, ALC_INVALID_VALUE); + return NULL; + } + if(deviceName && (!deviceName[0] || strcasecmp(deviceName, "openal soft") == 0 || strcasecmp(deviceName, "openal-soft") == 0)) deviceName = NULL; -- cgit v1.2.3