From 6e5e659047b68b84a55ee110c02c2de08897bc62 Mon Sep 17 00:00:00 2001 From: Cai Biesinger Date: Thu, 31 Dec 2020 20:35:13 -0800 Subject: [PATCH] Fixing rare out-of-bounds crash --- colorchord2/decompose.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorchord2/decompose.c b/colorchord2/decompose.c index 5746263..566a4dd 100644 --- a/colorchord2/decompose.c +++ b/colorchord2/decompose.c @@ -24,7 +24,7 @@ int DecomposeHistogram( float * histogram, int bins, struct NoteDists * out_dist float this = histogram[i]; float next = histogram[(i+1)%bins]; - if( prev > this || next > this ) continue; + if( prev >= this || next > this ) continue; if( prev == this && next == this ) continue; //i is at a peak...