Fixed out-of-bounds access in SB16/AWE32 DSP filter.

This commit is contained in:
SarahW 2018-02-14 17:52:19 +00:00
commit 96deba1ffa

View file

@ -361,7 +361,7 @@ static inline float low_fir_sb16(int i, float NewSample)
//Calculate the new output //Calculate the new output
x[i][pos] = NewSample; x[i][pos] = NewSample;
for (n = 0; n < ((SB16_NCoef+1)-pos); n++) for (n = 0; n < ((SB16_NCoef+1)-pos) && n < SB16_NCoef; n++)
out += low_fir_sb16_coef[n] * x[i][n+pos]; out += low_fir_sb16_coef[n] * x[i][n+pos];
for (; n < SB16_NCoef; n++) for (; n < SB16_NCoef; n++)
out += low_fir_sb16_coef[n] * x[i][(n+pos) - (SB16_NCoef+1)]; out += low_fir_sb16_coef[n] * x[i][(n+pos) - (SB16_NCoef+1)];