shithub: dumb

Download patch

ref: 82f65ee68c0d49d7419769992da22131ac6d48ec
parent: 1dbeaf67c98af889a5a71fec6ad1e14e470461ac
author: Chris Moeller <[email protected]>
date: Mon Jan 11 04:00:01 EST 2010

{5/31/2006 8:36:40 PM}2006-05-30 00:04 UTC - kode54
- XM reader now truncates instrument envelope lengths to 12, and performs
  some basic envelope loop checking, similar to Open ModPlug Tracker.
  (revive_nimnone.xm)

git-tfs-id: [http://localhost:8080/tfs/DefaultCollection/]$/foobar2000/files/plugins.root;C95

--- a/dumb/src/it/readxm.c
+++ b/dumb/src/it/readxm.c
@@ -321,10 +321,16 @@
 	int i, pos;
 
 	if (envelope->n_nodes > 12) {
+		/* XXX
 		TRACE("XM error: wrong number of envelope nodes (%d)\n", envelope->n_nodes);
 		envelope->n_nodes = 0;
-		return -1;
+		return -1; */
+		envelope->n_nodes = 12;
 	}
+
+	if (envelope->sus_loop_start >= 12) envelope->flags &= ~IT_ENVELOPE_SUSTAIN_LOOP;
+	if (envelope->loop_end >= 12) envelope->loop_end = 0;
+	if (envelope->loop_start >= envelope->loop_end) envelope->flags &= ~IT_ENVELOPE_LOOP_ON;
 
 	pos = 0;
 	for (i = 0; i < envelope->n_nodes; i++) {