summaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-21 23:09:31 -0700
committerChris Robinson <[email protected]>2009-09-21 23:09:31 -0700
commit4cd41e3e08740165eb22a3220fdbc368bddc4cd2 (patch)
treef346e744d461dc3ec17871659807522cbd920137 /OpenAL32/alSource.c
parentb641f993accd1aa8a6e6fa1300888d35e00de90f (diff)
Don't allow setting an invalid auxiliary send
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 30be074e..74591ff2 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -671,6 +671,7 @@ ALAPI void ALAPIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1, AL
if(alIsSource(source))
{
ALsource *pSource = (ALsource*)ALTHUNK_LOOKUPENTRY(source);
+ ALCdevice *Device = pContext->Device;
switch (eParam)
{
@@ -681,8 +682,8 @@ ALAPI void ALAPIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1, AL
break;
case AL_AUXILIARY_SEND_FILTER:
- if(lValue2 >= 0 && lValue2 < MAX_SENDS &&
- (alIsAuxiliaryEffectSlot(lValue1) || lValue1 == 0) &&
+ if((ALuint)lValue2 < Device->NumAuxSends &&
+ (lValue1 == 0 || alIsAuxiliaryEffectSlot(lValue1)) &&
alIsFilter(lValue3))
{
ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(lValue1);