diff options
author | Chris Robinson <[email protected]> | 2018-03-04 14:00:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-03-08 17:48:21 -0800 |
commit | 19281868dce20d47344bd059b5f3c4af5264baaa (patch) | |
tree | 2cddfe1e0faaf797ad65462f3c0038a36db34662 /OpenAL32/alAuxEffectSlot.c | |
parent | 5133fe5115ed3102e37a3f537cb63f90ae0ea5ab (diff) |
Properly limit the max number of effect slots to 2^31 - 1
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 6eb6187b..9ccfaa36 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -109,7 +109,6 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo ALCdevice *device; ALCcontext *context; ALsizei cur; - ALenum err; context = GetContextRef(); if(!context) return; @@ -131,6 +130,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo ALeffectslotPtr *iter = VECTOR_BEGIN(context->EffectSlotList); ALeffectslotPtr *end = VECTOR_END(context->EffectSlotList); ALeffectslot *slot = NULL; + ALenum err = AL_OUT_OF_MEMORY; for(;iter != end;iter++) { @@ -139,18 +139,10 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo } if(iter == end) { - if(VECTOR_SIZE(context->EffectSlotList) >= INT_MAX) - { - UnlockEffectSlotList(context); - - alDeleteAuxiliaryEffectSlots(cur, effectslots); - SETERR_GOTO(context, err, done, "Too many effect slot objects"); - } VECTOR_PUSH_BACK(context->EffectSlotList, NULL); iter = &VECTOR_BACK(context->EffectSlotList); } slot = al_calloc(16, sizeof(ALeffectslot)); - err = AL_OUT_OF_MEMORY; if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR) { al_free(slot); |