Skip to content

Version 1.08

Choose a tag to compare

@rh1tech rh1tech released this 24 Dec 16:10
· 11 commits to main since this release

Fix MIDI streaming crash on music loop

Root cause: FreeTrack used num_events which became a cumulative count (chunk_start + chunk_count) after loading multiple streaming chunks, but the events array is only sized for MIDI_STREAM_CHUNK_SIZE (2000). This caused buffer overread when freeing events.

Fixes:

  • FreeTrack now uses chunk_count (actual events in buffer) instead of num_events for streaming mode
  • Move temp MIDI file deletion from I_OPL_RegisterSong to MIDI_FreeFile to prevent reading from deleted file during music loop restart
  • Add comprehensive debug logging for music system

Also includes debug logging for level transitions and switch sounds.