zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit b724f34784ca7c8fd315ce8a09226071e8cdabd4
parent b2c23d25fd8ec55aa92a0ff9b464c00b86e7d3f3
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Wed, 14 Mar 2012 12:13:00 -0400

OscilGen: Fixing segfault

- prepare() should no longer produce a segfault due to an off by one error

Diffstat:
Msrc/Synth/OscilGen.cpp | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Synth/OscilGen.cpp b/src/Synth/OscilGen.cpp @@ -615,7 +615,7 @@ void OscilGen::prepare() clearAll(oscilFFTfreqs); if(Pcurrentbasefunc == 0) //the sine case - for(int i = 0; i < MAX_AD_HARMONICS; ++i) { + for(int i = 0; i < MAX_AD_HARMONICS - 1; ++i) { oscilFFTfreqs[i + 1].real() = -hmag[i] * sinf(hphase[i] * (i + 1)) / 2.0f;