ref: 482fab8971fb42305186494c1aad8f7c388c6b0f
parent: e391790ac75d01f4eb89534f17f0a58ba0273b5a
author: Paul Brossier <piem@piem.org>
date: Sat Aug 1 06:54:37 EDT 2015
src/tempo/beattracking.c: avoid segfault on silence (closes #24)
--- a/src/tempo/beattracking.c
+++ b/src/tempo/beattracking.c
@@ -266,6 +266,7 @@
{
sint_t k = 0;
smpl_t three_energy = 0., four_energy = 0.;
+ if (gp < 2) return 4;
if (acflen > 6 * gp + 2) {
for (k = -2; k < 2; k++) {
three_energy += acf->data[3 * gp + k];