diff options
author | Chris Robinson <[email protected]> | 2011-08-19 02:55:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-08-19 02:55:36 -0700 |
commit | 711f0a29ecfca285296e0691fc8032cf0041c964 (patch) | |
tree | 7a3b951c3956658d8e64bb4b5fc6ccff4eec0cb6 /Alc | |
parent | e8e12865728289e6e9d428bd868d6ec4dc7e9d4c (diff) |
Make sure there's a valid backend before trying to open a device
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |