diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2013-06-19 16:04:42 -0700 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2013-06-19 16:23:50 -0700 |
commit | 9438ea161e94491fc4f73df3a68ce9229193deda (patch) | |
tree | c758f945af928adc537d7f6c33119ab1a0e8f85d /src/vector.c | |
parent | 5f76abb520203a69a328cebe851f03e41c0ac3ea (diff) | |
download | LibXtract-9438ea161e94491fc4f73df3a68ce9229193deda.tar.gz LibXtract-9438ea161e94491fc4f73df3a68ce9229193deda.tar.bz2 LibXtract-9438ea161e94491fc4f73df3a68ce9229193deda.zip |
Don't read past end of spectral data array
Diffstat (limited to 'src/vector.c')
-rw-r--r-- | src/vector.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vector.c b/src/vector.c index 5d88882..14bee9d 100644 --- a/src/vector.c +++ b/src/vector.c @@ -116,6 +116,11 @@ int xtract_spectrum(const double *data, const int N, const void *argv, double *r { ++n; } + if(n == M) + { + XTRACT_SET_FREQUENCY; + break; + } real = fft[n*2]; imag = fft[n*2+1]; @@ -161,6 +166,11 @@ int xtract_spectrum(const double *data, const int N, const void *argv, double *r { ++n; } + if(n == M) + { + XTRACT_SET_FREQUENCY; + break; + } real = fft[n*2]; imag = fft[n*2+1]; @@ -192,6 +202,11 @@ int xtract_spectrum(const double *data, const int N, const void *argv, double *r { ++n; } + if(n == M) + { + XTRACT_SET_FREQUENCY; + break; + } real = fft[n*2]; imag = fft[n*2+1]; @@ -231,6 +246,12 @@ int xtract_spectrum(const double *data, const int N, const void *argv, double *r { ++n; } + if(n == M) + { + XTRACT_SET_FREQUENCY; + break; + } + real = fft[n*2]; imag = fft[n*2+1]; #else |