From 5883cb239be8e76fcbcf30f88ee19a039068bbf6 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 30 Oct 2017 19:58:15 -0700 Subject: [PATCH] Fix meta length parsing for >127 byte entries In find_note, the meta_len was hardcoded as a single byte encoding, but per the spec and some files with long comments and copyrights, it is actually encoded as a varlen. Use the varlen parser (which defaults to the old behavior of 1-byte for <128 len fields) instead. --- miditones.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miditones.c b/miditones.c index 1d62585..2efca15 100644 --- a/miditones.c +++ b/miditones.c @@ -838,7 +838,7 @@ void find_note (int tracknum) { } if (event == 0xff) { /* meta-event */ meta_cmd = *t->trkptr++; - meta_length = *t->trkptr++; + meta_length = get_varlen (&t->trkptr); switch (meta_cmd) { case 0x00: if (logparse)