pianobooster / PianoBooster

A MIDI file player/game that displays the musical notes and teaches you how to play the piano.
Other
410 stars 79 forks source link

Midi is corrupted error when char is unsigned #334

Open felipemanga opened 1 year ago

felipemanga commented 1 year ago

The following line (MidiTrack.cpp, line 236) assumes char is signed: keySig = static_cast<char>(readByte()); // force sign conversion ... This fails on platforms where it isn't. A potential fix is: keySig = static_cast<signed char>(readByte());

Martchus commented 1 year ago

I suggest you create a PR. Since this project isn't maintained very actively it may take a while until it gets merged, though.