fix: security issues

This commit is contained in:
2025-11-10 14:38:01 +01:00
parent 8f19c243f0
commit fa411c8b18
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -52,6 +52,10 @@ static long get_average_tap_duration(Tempo tempo) {
running_total += tempo.tap_durations[i];
}
if (amount == 0) {
amount = 1; // should never happen
}
average_tap_duration = running_total / amount;
if (average_tap_duration < MIN_BEAT_LENGTH) {
return MIN_BEAT_LENGTH;