shithub: dumb

Download patch

ref: 6be02dc3eb093c6f5ce8cce0c131a3fbef7b062c
parent: 86d706024a29c2c3c4f7740b8671110f602cded6
author: Christopher Snowhill <kode54@gmail.com>
date: Tue Sep 12 10:03:57 EDT 2017

Require at least one instrument and one pattern.

--- a/src/it/readxm.c
+++ b/src/it/readxm.c
@@ -910,7 +910,7 @@
 	/* sanity checks */
 	// XXX
 	i = header_size - 4 - 2 * 8; /* Maximum number of orders expected */
-	if (dumbfile_error(f) || sigdata->n_orders <= 0 || sigdata->n_orders > i || sigdata->n_patterns > 256 || sigdata->n_instruments > 256 || n_channels > DUMB_IT_N_CHANNELS) {
+	if (dumbfile_error(f) || sigdata->n_orders <= 0 || sigdata->n_orders > i || !sigdata->n_patterns || sigdata->n_patterns > 256 || !sigdata->n_instruments || sigdata->n_instruments > 256 || n_channels > DUMB_IT_N_CHANNELS) {
 		_dumb_it_unload_sigdata(sigdata);
 		return NULL;
 	}