From 5670913e9b47cde40a8797bd885c4aa22610069d Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 8 Jun 2011 11:36:52 +0200 Subject: [PATCH] plugins: Pitch.ar - fix crash for high execution period Signed-off-by: Tim Blechmann --- common/Source/plugins/DelayUGens.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/Source/plugins/DelayUGens.cpp b/common/Source/plugins/DelayUGens.cpp index 1d69aee2d17..39f574c587c 100644 --- a/common/Source/plugins/DelayUGens.cpp +++ b/common/Source/plugins/DelayUGens.cpp @@ -1668,7 +1668,7 @@ void Pitch_Ctor(Pitch *unit) unit->m_execPeriod = (int)(unit->m_srate / execfreq); unit->m_execPeriod = sc_max(unit->m_execPeriod, unit->mWorld->mFullRate.mBufLength); - unit->m_size = unit->m_maxperiod << 1; + unit->m_size = sc_max(unit->m_maxperiod << 1, unit->m_execPeriod); unit->m_buffer = (float*)RTAlloc(unit->mWorld, unit->m_size * sizeof(float));