From: Paul Brossier Date: Sun, 16 Nov 2025 13:32:13 +0000 (+0100) Subject: [specdesc] fix definition of rolloff (closes gh-318, thanks to @Polochon-street) X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=1e35340b12588e2245c6fd893bdbf78be50d87c7;p=aubio.git [specdesc] fix definition of rolloff (closes gh-318, thanks to @Polochon-street) We now return at least the first bin, and at most the last bin number, to prevent returning a value greater than the length of the norm vector size. --- diff --git a/src/spectral/statistics.c b/src/spectral/statistics.c index 4fd66c00..d3033643 100644 --- a/src/spectral/statistics.c +++ b/src/spectral/statistics.c @@ -199,6 +199,6 @@ aubio_specdesc_rolloff (aubio_specdesc_t *o UNUSED, const cvec_t * spec, rollsum += SQR (spec->norm[j]); j++; } - desc->data[0] = j; + desc->data[0] = MAX (1, j) - 1.0f; } }