From 4b52ce739708b623b122a74f53048a488da9f780 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 30 Oct 2017 20:08:23 -0700 Subject: [PATCH] Fix meta_len MIDI entry parsing meta_length is a varlen, not a single byte. Use get_varlen() to handle >127 byte entries automatically. --- src/AudioGeneratorMIDI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AudioGeneratorMIDI.cpp b/src/AudioGeneratorMIDI.cpp index 6f622da..8958d3c 100644 --- a/src/AudioGeneratorMIDI.cpp +++ b/src/AudioGeneratorMIDI.cpp @@ -213,7 +213,7 @@ void AudioGeneratorMIDI::find_note (int tracknum) { } if (event == 0xff) { /* meta-event */ meta_cmd = buffer_byte (t->trkptr++); - meta_length = buffer_byte (t->trkptr++); + meta_length = get_varlen(&t->trkptr); switch (meta_cmd) { case 0x00: break;