diff options
author | Chris Robinson <[email protected]> | 2012-06-19 00:25:45 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-06-19 00:25:45 -0700 |
commit | ef1f8aa9a003e56c467ab16ac2c2bef551705f7f (patch) | |
tree | c470dd6391e5fd1b93122b67a061e9912f2490cc /Alc/ALc.c | |
parent | a5ac6eb5247f6489f56cea332fdf73798df7d062 (diff) |
Don't needlessly verify a device
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -2316,19 +2316,20 @@ ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar { ALCvoid *ptr = NULL; - device = VerifyDevice(device); - if(!funcName) + { + device = VerifyDevice(device); alcSetError(device, ALC_INVALID_VALUE); + if(device) ALCdevice_DecRef(device); + } else { ALsizei i = 0; - while(alcFunctions[i].funcName && strcmp(alcFunctions[i].funcName,funcName) != 0) + while(alcFunctions[i].funcName && strcmp(alcFunctions[i].funcName, funcName) != 0) i++; ptr = alcFunctions[i].address; } - if(device) - ALCdevice_DecRef(device); + return ptr; } |