From af5720a7e5ece0711550fa86f30a59f30b819bbd Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 20 Dec 2006 03:04:29 +0100 Subject: [PATCH] Fix a buffer overrun that was introduced in the splitting. --- pitchdetector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pitchdetector.cpp b/pitchdetector.cpp index 71e5875..cf0abe0 100644 --- a/pitchdetector.cpp +++ b/pitchdetector.cpp @@ -38,7 +38,7 @@ PitchDetector::~PitchDetector() std::pair PitchDetector::detect_pitch(short *buf) { unsigned buf_len = fft_length / pad_factor / overlap; - memmove(in, in + buf_len, (fft_length - buf_len) * sizeof(double)); + memmove(in, in + buf_len, (fft_length / pad_factor - buf_len) * sizeof(double)); for (unsigned i = 0; i < buf_len; ++i) in[i + (fft_length / pad_factor - buf_len)] = double(buf[i]); -- 2.39.2