From 2fd3c4d94f41a61a0d5618bc40123eaa102a4384 Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 5 Sep 2017 11:28:14 +0200 Subject: [PATCH] fix the still existing wrong array access in psd smooth routine --- src/frontend/com_fft.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/com_fft.c b/src/frontend/com_fft.c index 8420ec3fa..555d0a3dc 100644 --- a/src/frontend/com_fft.c +++ b/src/frontend/com_fft.c @@ -470,9 +470,9 @@ com_psd(wordlist *wl) } for (j = fpts-hsmooth; j < fpts; j++) { sum = 0.; - for (jj = 0; jj < smooth-(j-(fpts-hsmooth))-1; jj++) + for (jj = 0; jj < fpts+hsmooth-j-1; jj++) sum += fdvec[i][j-hsmooth+jj+1].cx_real; - sum /= (double) (fpts-j+hsmooth-1); + sum /= (double) (fpts+hsmooth-j-1); reald[j] = sum; } for (j = 0; j < fpts; j++)