aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-04 05:44:37 -0800
committerChris Robinson <[email protected]>2012-03-04 05:44:37 -0800
commit302c08a14bf10a97fa607efbaa7b15f7d2e1bc4a (patch)
tree3457062987945f1edc12d3fb5a169e1b86b4a7b6 /Alc
parentb643f13a6e96df0332d9b0ff66b411c605d52919 (diff)
Enforce range limits on periods and period_size.
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 35c5607d..05c24bd2 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2583,10 +2583,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
}
ConfigValueUInt(NULL, "periods", &device->NumUpdates);
- if(device->NumUpdates < 2) device->NumUpdates = 4;
+ device->NumUpdates = clampu(device->NumUpdates, 2, 16);
ConfigValueUInt(NULL, "period_size", &device->UpdateSize);
- if(device->UpdateSize == 0) device->UpdateSize = 1024;
+ device->UpdateSize = clampu(device->UpdateSize, 64, 8192);
ConfigValueUInt(NULL, "sources", &device->MaxNoOfSources);
if(device->MaxNoOfSources == 0) device->MaxNoOfSources = 256;