Merge pull request #116 from CaiB/master

Fixing rare out-of-bounds crash
This commit is contained in:
CNLohr 2021-01-01 04:24:39 -05:00 committed by GitHub
commit f8fb768415
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ int DecomposeHistogram( float * histogram, int bins, struct NoteDists * out_dist
float this = histogram[i]; float this = histogram[i];
float next = histogram[(i+1)%bins]; float next = histogram[(i+1)%bins];
if( prev > this || next > this ) continue; if( prev >= this || next > this ) continue;
if( prev == this && next == this ) continue; if( prev == this && next == this ) continue;
//i is at a peak... //i is at a peak...