From 95e71c35ba7c54f9c6cd248714195cefe17c77cb Mon Sep 17 00:00:00 2001 From: Franz Zotter Date: Tue, 22 Jul 2008 17:23:43 +0000 Subject: corrected [mtx_rfft] and [mtx_rifft] memory bugs. svn path=/trunk/externals/iem/iemmatrix/; revision=10208 --- src/mtx_rfft.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mtx_rfft.c') diff --git a/src/mtx_rfft.c b/src/mtx_rfft.c index d0890c3..2d9d18f 100644 --- a/src/mtx_rfft.c +++ b/src/mtx_rfft.c @@ -137,10 +137,13 @@ static void readFloatFromList (int n, t_atom *l, t_float *f) } #ifdef HAVE_FFTW3_H -static void writeFFTWComplexPartIntoList (int n, t_atom *l, fftw_complex *f, enum ComplexPart p) +static void writeFFTWComplexPartIntoList (int n, t_atom *l, fftw_complex *c, enum ComplexPart p) { - for (;n--;f++, l++) - SETFLOAT (l, ((t_float)*f[p])); + t_float f; + while (n--) { + f=(t_float)c[n][p]; + SETFLOAT (l+n, f); + } } static void readDoubleFromList (int n, t_atom *l, double *f) { -- cgit v1.2.1