shithub: dumb

Download patch

ref: bf7cca5d5e0c4893b70b5858c4264d592b26e84b
parent: 161758dd0a5d7bd0e07fdc596db4e24f1ca107ac
author: Christopher Snowhill <kode54@gmail.com>
date: Tue Sep 12 12:32:01 EDT 2017

Initialize more variables in case of malformed patterns.

--- a/src/it/itrender.c
+++ b/src/it/itrender.c
@@ -3789,7 +3789,7 @@
 					}
 				}
 			}
-		} else if (channel->note_delay_count) {
+		} else if (channel->note_delay_count && channel->note_delay_entry) {
 			channel->note_delay_count--;
 			if (channel->note_delay_count == 0)
 				process_note_data(sigrenderer, channel->note_delay_entry, 0);
@@ -5332,6 +5332,10 @@
 		channel->inv_loop_speed = 0;
 		channel->inv_loop_offset = 0;
 		channel->playing = NULL;
+		channel->key_off_count = 0;
+		channel->note_cut_count = 0;
+		channel->note_delay_count = 0;
+		channel->note_delay_entry = 0;
 #ifdef BIT_ARRAY_BULLSHIT
 		channel->played_patjump = NULL;
 		channel->played_patjump_order = 0xFFFE;