diff options
author | YamaArashi <shadow962@live.com> | 2016-08-27 02:41:15 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-08-27 02:41:15 -0700 |
commit | a99534f82c83fbe6f4a2027b2a3d8cd63cb49054 (patch) | |
tree | b1c991da68a0bcfaba5a27a7ea933c52e60f3d05 | |
parent | 2e7a8763929105fb3feb5ece23d21a4ff5dd1c5b (diff) |
fix potential bug when using compression
-rw-r--r-- | tools/mid2agb/agb.cpp | 2 | ||||
-rw-r--r-- | tools/mid2agb/midi.cpp | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/tools/mid2agb/agb.cpp b/tools/mid2agb/agb.cpp index 29dff20d6..e3e5d8efe 100644 --- a/tools/mid2agb/agb.cpp +++ b/tools/mid2agb/agb.cpp @@ -339,7 +339,7 @@ void PrintAgbTrack(std::vector<Event>& events) if (!foundVolBeforeNote) PrintByte("\tVOL , 127*%s_mvl/mxv", g_asmLabel.c_str()); - for (unsigned i = 0; i < events.size(); i++) + for (unsigned i = 0; events[i].type != EventType::EndOfTrack; i++) { const Event& event = events[i]; diff --git a/tools/mid2agb/midi.cpp b/tools/mid2agb/midi.cpp index 82c8e15bc..825c923c2 100644 --- a/tools/mid2agb/midi.cpp +++ b/tools/mid2agb/midi.cpp @@ -933,8 +933,6 @@ void ReadMidiTracks() if (g_compressionEnabled) Compress(*events); - events->pop_back(); // Remove the EndOfTrack event. - PrintAgbTrack(*events); g_agbTrack++; |