Skip to content

Commit

Permalink
Merge pull request #115 from vuki/lps
Browse files Browse the repository at this point in the history
Fix out-of-bounds read in LentPitShift
  • Loading branch information
garyscavone authored Apr 23, 2021
2 parents deddcba + d308c8a commit 1fec6e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/LentPitShift.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ inline void LentPitShift::process()
dpt[delay_] = dt[delay_] * delay_ / cumDt[delay_];

// 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
if ( dpt[delay_-1] < threshold_ ){
lastPeriod_ = delay_-1;
Expand Down

0 comments on commit 1fec6e0

Please sign in to comment.