From 283d93f869b4f72c37536686a27db782a7b5c070 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 21 Jul 2006 13:42:07 +0000 Subject: [PATCH] avoid out of boundaries write in yinfft avoid out of boundaries write in yinfft --- src/pitchyinfft.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pitchyinfft.c b/src/pitchyinfft.c index 0c7b0f2e..98fffe7f 100644 --- a/src/pitchyinfft.c +++ b/src/pitchyinfft.c @@ -101,9 +101,11 @@ smpl_t aubio_pitchyinfft_detect(aubio_pitchyinfft_t * p, fvec_t * input, smpl_t aubio_mfft_do(p->fft,p->winput,p->fftout); for (l=0; l < p->fftout->length; l++){ p->sqrmag->data[0][l] = SQR(p->fftout->norm[0][l]); - p->sqrmag->data[0][(p->fftout->length-1)*2-l] = - SQR(p->fftout->norm[0][l]); p->sqrmag->data[0][l] *= p->weight->data[0][l]; + } + for (l=1; l < p->fftout->length; l++){ + p->sqrmag->data[0][(p->fftout->length-1)*2-l] = + SQR(p->fftout->norm[0][l]); p->sqrmag->data[0][(p->fftout->length-1)*2-l] *= p->weight->data[0][l]; } -- 2.26.2