diff options
author | Chris Robinson <[email protected]> | 2012-12-24 05:49:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-12-24 05:49:44 -0800 |
commit | 564a1822595e287cf808ea63a03d96719e3cc7b4 (patch) | |
tree | b88ae0c24868046d27cea03ee4f88771e50bd52d /Alc | |
parent | 9cd086a7079de9d2c109c0fd63b9694145f5840d (diff) |
Avoid an underflow in the SSE mixers if BufferSize is less than 4
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/mixer_sse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index 540a0d72..3c45fd21 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -155,7 +155,7 @@ void MixDirect_SSE(const DirectParams *params, const ALfloat *RESTRICT data, ALu ClickRemoval[c] -= data[0]*DrySend; gain = _mm_set1_ps(DrySend); - for(pos = 0;pos < BufferSize-3;pos += 4) + for(pos = 0;BufferSize-pos > 3;pos += 4) { const __m128 val4 = _mm_load_ps(&data[pos]); __m128 dry4 = _mm_load_ps(&DryBuffer[c][OutPos+pos]); @@ -189,7 +189,7 @@ void MixSend_SSE(const SendParams *params, const ALfloat *RESTRICT data, WetClickRemoval[0] -= data[0] * WetGain; gain = _mm_set1_ps(WetGain); - for(pos = 0;pos < BufferSize-3;pos+=4) + for(pos = 0;BufferSize-pos > 3;pos += 4) { const __m128 val4 = _mm_load_ps(&data[pos]); __m128 wet4 = _mm_load_ps(&WetBuffer[0][OutPos+pos]); |