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 /Alc | |
parent | 5133fe5115ed3102e37a3f537cb63f90ae0ea5ab (diff) |
Properly limit the max number of effect slots to 2^31 - 1
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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( |