aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-03-04 14:00:28 -0800
committerChris Robinson <[email protected]>2018-03-08 17:48:21 -0800
commit19281868dce20d47344bd059b5f3c4af5264baaa (patch)
tree2cddfe1e0faaf797ad65462f3c0038a36db34662 /Alc
parent5133fe5115ed3102e37a3f537cb63f90ae0ea5ab (diff)
Properly limit the max number of effect slots to 2^31 - 1
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index c72a1833..554a4951 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -4139,6 +4139,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
ConfigValueUInt(deviceName, NULL, "slots", &device->AuxiliaryEffectSlotMax);
if(device->AuxiliaryEffectSlotMax == 0) device->AuxiliaryEffectSlotMax = 64;
+ else device->AuxiliaryEffectSlotMax = minu(device->AuxiliaryEffectSlotMax, INT_MAX);
if(ConfigValueInt(deviceName, NULL, "sends", &device->NumAuxSends))
device->NumAuxSends = clampi(
@@ -4487,6 +4488,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
ConfigValueUInt(NULL, NULL, "slots", &device->AuxiliaryEffectSlotMax);
if(device->AuxiliaryEffectSlotMax == 0) device->AuxiliaryEffectSlotMax = 64;
+ else device->AuxiliaryEffectSlotMax = minu(device->AuxiliaryEffectSlotMax, INT_MAX);
if(ConfigValueInt(NULL, NULL, "sends", &device->NumAuxSends))
device->NumAuxSends = clampi(