Fix CreateSMF's SysEx writing

- It was wrong before. It might still be wrong, but at least it doesn't
  look obviously wrong anymore.
This commit is contained in:
Randy Heit 2015-12-29 17:14:13 -06:00
parent 545e2f7c69
commit 6d2e93254f
1 changed files with 8 additions and 2 deletions

View File

@ -1196,9 +1196,15 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
len--;
file.Push(MIDI_SYSEX);
WriteVarLen(file, len);
memcpy(&file[file.Reserve(len - 1)], bytes, len);
running_status = 255;
memcpy(&file[file.Reserve(len)], bytes + 1, len);
}
else
{
file.Push(MIDI_SYSEXEND);
WriteVarLen(file, len);
memcpy(&file[file.Reserve(len)], bytes, len);
}
running_status = 255;
}
else if (MEVT_EVENTTYPE(event[2]) == 0)
{