From 7f850d8fb08547593352a997c89320ce23d07a73 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 15 Jan 2008 15:53:06 -0800 Subject: Make sure a valid context is set for effect slots --- OpenAL32/alAuxEffectSlot.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 2b77e063..ae62d8fd 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -40,6 +40,11 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo ALsizei i; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (n > 0) @@ -91,6 +96,11 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effect ALsizei i; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (n >= 0) @@ -146,6 +156,11 @@ AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot) ALeffectslot **list; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return AL_FALSE; + } SuspendContext(Context); list = &g_AuxiliaryEffectSlotList; @@ -162,6 +177,11 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -209,6 +229,11 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -238,6 +263,11 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param (void)flValue; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -269,6 +299,11 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -295,6 +330,11 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -327,6 +367,11 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -354,6 +399,11 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum pa ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) @@ -382,6 +432,11 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p ALCcontext *Context; Context = alcGetCurrentContext(); + if(!Context) + { + alSetError(AL_INVALID_OPERATION); + return; + } SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) -- cgit v1.2.3