shithub: dumb

Download patch

ref: 86d706024a29c2c3c4f7740b8671110f602cded6
parent: e431d9dd5f76e49d87acc67e58e84eef0c333839
author: Christopher Snowhill <kode54@gmail.com>
date: Tue Sep 12 09:39:13 EDT 2017

Fix divide by zero if tempo is somehow set to zero.

--- a/src/it/itrender.c
+++ b/src/it/itrender.c
@@ -4301,6 +4301,9 @@
 static int process_tick(DUMB_IT_SIGRENDERER *sigrenderer)
 {
 	DUMB_IT_SIGDATA *sigdata = sigrenderer->sigdata;
+	
+	if ( !sigrenderer->tempo ) // problematic, causes divide by zero below
+		return 1;
 
 	// Set note vol/freq to vol/freq set for each channel
 
@@ -5598,6 +5601,8 @@
 	LONG_LONG t;
 
 	if (sigrenderer->order < 0) return 0; // problematic
+	
+	if (!sigrenderer->tempo) return 0; // also problematic
 
 	pos = 0;
 	dt = (int)(delta * 65536.0f + 0.5f);