aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h4
-rw-r--r--OpenAL32/alAuxEffectSlot.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 82877735..5efbbbe7 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -167,6 +167,8 @@ struct ALCdevice_struct
// Maximum number of sources that can be created
ALuint MaxNoOfSources;
+ // Maximum number of slots that can be created
+ ALuint AuxiliaryEffectSlotMax;
// Context created on this device
ALCcontext *Context;
@@ -195,8 +197,6 @@ struct ALCcontext_struct
struct ALeffectslot *AuxiliaryEffectSlot;
ALuint AuxiliaryEffectSlotCount;
- // Maximum number of slots that can be created
- ALuint AuxiliaryEffectSlotMax;
ALenum LastError;
ALboolean InUse;
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index f606a099..805bdb4b 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -49,7 +49,9 @@ ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
if (n > 0)
{
- if(Context->AuxiliaryEffectSlotCount+n <= Context->AuxiliaryEffectSlotMax)
+ ALCdevice *Device = alcGetContextsDevice(Context);
+
+ if(Context->AuxiliaryEffectSlotCount+n <= Device->AuxiliaryEffectSlotMax)
{
// Check that enough memory has been allocted in the 'effectslots' array for n Effect Slots
if (!IsBadWritePtr((void*)effectslots, n * sizeof(ALuint)))