aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer/hrtf_inc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-04-18 20:39:52 -0700
committerChris Robinson <[email protected]>2018-04-18 20:39:52 -0700
commitf96a8fe369e317a6203bec5e814761fe8a12531e (patch)
tree240fae4a5a1072e3721e6976058bc50d1a766c9f /Alc/mixer/hrtf_inc.c
parent150586d7fef722da17b96697ca0c1f78b2d10eb4 (diff)
Add some ASSUME statements that ensure mixing at least 1 sample
Diffstat (limited to 'Alc/mixer/hrtf_inc.c')
-rw-r--r--Alc/mixer/hrtf_inc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Alc/mixer/hrtf_inc.c b/Alc/mixer/hrtf_inc.c
index ad0daa63..d6bd8042 100644
--- a/Alc/mixer/hrtf_inc.c
+++ b/Alc/mixer/hrtf_inc.c
@@ -27,6 +27,9 @@ void MixHrtf(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
ALfloat left, right;
ALsizei i;
+ ASSUME(IrSize >= 4);
+ ASSUME(BufferSize > 0);
+
LeftOut += OutPos;
RightOut += OutPos;
for(i = 0;i < BufferSize;i++)
@@ -65,6 +68,9 @@ void MixHrtfBlend(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
ALfloat left, right;
ALsizei i;
+ ASSUME(IrSize >= 4);
+ ASSUME(BufferSize > 0);
+
LeftOut += OutPos;
RightOut += OutPos;
for(i = 0;i < BufferSize;i++)
@@ -100,6 +106,9 @@ void MixDirectHrtf(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
ALfloat insample;
ALsizei i;
+ ASSUME(IrSize >= 4);
+ ASSUME(BufferSize > 0);
+
for(i = 0;i < BufferSize;i++)
{
Values[(Offset+IrSize)&HRIR_MASK][0] = 0.0f;