mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
Fix out-of-bounds read in LenPitShift
This commit is contained in:
@@ -142,7 +142,7 @@ inline void LentPitShift::process()
|
|||||||
dpt[delay_] = dt[delay_] * delay_ / cumDt[delay_];
|
dpt[delay_] = dt[delay_] * delay_ / cumDt[delay_];
|
||||||
|
|
||||||
// Look for a minimum
|
// Look for a minimum
|
||||||
if ( dpt[delay_-1]-dpt[delay_-2] < 0 && dpt[delay_]-dpt[delay_-1] > 0 ) {
|
if ( delay_ > 1 && dpt[delay_-1]-dpt[delay_-2] < 0 && dpt[delay_]-dpt[delay_-1] > 0 ) {
|
||||||
// Check if the minimum is under the threshold
|
// Check if the minimum is under the threshold
|
||||||
if ( dpt[delay_-1] < threshold_ ){
|
if ( dpt[delay_-1] < threshold_ ){
|
||||||
lastPeriod_ = delay_-1;
|
lastPeriod_ = delay_-1;
|
||||||
|
|||||||
Reference in New Issue
Block a user