shithub: neindaw

Download patch

ref: 0c2f81916eff6df420133848ec87f8fecab86f0e
parent: 0d8d67d11e9fad2347795ebf330375651e5303ab
author: Sigrid Haflínudóttir <[email protected]>
date: Tue May 12 09:05:14 EDT 2020

piper: do not divide by 0

--- a/piper/piper.c
+++ b/piper/piper.c
@@ -139,7 +139,8 @@
 						c.note[n].vel = (float)i36(*s) / 16.0;
 						s++;
 						if (*s != 0) {
-							c.note[n].dur = bar / (float)i36(*s);
+							f = i36(*s);
+							c.note[n].dur = bar / (f != 0 ? f : 1);
 							s++;
 						}
 					}