aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/mastering.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Alc/mastering.c b/Alc/mastering.c
index e7908828..306f0941 100644
--- a/Alc/mastering.c
+++ b/Alc/mastering.c
@@ -79,6 +79,9 @@ static void LinkChannels(Compressor *Comp, const ALsizei SamplesToDo, ALfloat (*
ALfloat *restrict sideChain = Comp->SideChain;
ALsizei c, i;
+ ASSUME(SamplesToDo > 0);
+ ASSUME(numChans > 0);
+
for(i = 0;i < SamplesToDo;i++)
sideChain[(index + i) & mask] = 0.0f;
@@ -109,6 +112,8 @@ static void CrestDetector(Compressor *Comp, const ALsizei SamplesToDo)
ALfloat y2_rms = Comp->LastRmsSq;
ALsizei i;
+ ASSUME(SamplesToDo > 0);
+
for(i = 0;i < SamplesToDo;i++)
{
ALfloat x_abs = sideChain[(index + i) & mask];
@@ -134,6 +139,8 @@ static void PeakDetector(Compressor *Comp, const ALsizei SamplesToDo)
ALfloat *restrict sideChain = Comp->SideChain;
ALsizei i;
+ ASSUME(SamplesToDo > 0);
+
for(i = 0;i < SamplesToDo;i++)
{
ALuint offset = (index + i) & mask;
@@ -155,6 +162,8 @@ static void PeakHoldDetector(Compressor *Comp, const ALsizei SamplesToDo)
SlidingHold *hold = Comp->Hold;
ALsizei i;
+ ASSUME(SamplesToDo > 0);
+
for(i = 0;i < SamplesToDo;i++)
{
ALsizei offset = (index + i) & mask;
@@ -201,6 +210,8 @@ static void GainCompressor(Compressor *Comp, const ALsizei SamplesToDo)
ALfloat c_dev = Comp->LastGainDev;
ALsizei i;
+ ASSUME(SamplesToDo > 0);
+
for(i = 0;i < SamplesToDo;i++)
{
const ALfloat y2_crest = crestFactor[i];
@@ -291,6 +302,9 @@ static void SignalDelay(Compressor *Comp, const ALsizei SamplesToDo, ALfloat (*r
ALfloat (*restrict delay)[BUFFERSIZE] = Comp->Delay;
ALsizei c, i;
+ ASSUME(SamplesToDo > 0);
+ ASSUME(numChans > 0);
+
for(c = 0;c < numChans;c++)
{
for(i = 0;i < SamplesToDo;i++)
@@ -410,6 +424,9 @@ void ApplyCompression(Compressor *Comp, const ALsizei SamplesToDo, ALfloat (*res
ALfloat *restrict sideChain = Comp->SideChain;
ALsizei c, i;
+ ASSUME(SamplesToDo > 0);
+ ASSUME(numChans > 0);
+
if(preGain != 1.0f)
{
for(c = 0;c < numChans;c++)