From 96deba1ffad4ede392a7f6209765c516b0146047 Mon Sep 17 00:00:00 2001 From: SarahW Date: Wed, 14 Feb 2018 17:52:19 +0000 Subject: [PATCH] Fixed out-of-bounds access in SB16/AWE32 DSP filter. --- src/filters.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters.h b/src/filters.h index c3431d4..6c84c04 100644 --- a/src/filters.h +++ b/src/filters.h @@ -361,7 +361,7 @@ static inline float low_fir_sb16(int i, float NewSample) //Calculate the new output 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]; for (; n < SB16_NCoef; n++) out += low_fir_sb16_coef[n] * x[i][(n+pos) - (SB16_NCoef+1)];