From c37834b27e43cdd3146ffa8d2a67a09d5ce79abe Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Mon, 15 Apr 2013 02:45:02 -0400 Subject: [PATCH] Fixes a minor bug found by valgrind in the bandwidth detector The energy calculation from the packed FFTs ended up reading out-of-bound memory for frequency zero. The bug was exposed by c5e04e4. --- src/analysis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis.c b/src/analysis.c index 734364b9..e4156d6d 100644 --- a/src/analysis.c +++ b/src/analysis.c @@ -101,7 +101,7 @@ static const int tbands[NB_TBANDS+1] = { }; static const int extra_bands[NB_TOT_BANDS+1] = { - 0, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 68, 80, 96, 120, 160, 200 + 1, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 68, 80, 96, 120, 160, 200 }; /*static const float tweight[NB_TBANDS+1] = {