Menu

#1421 "Attempt to get more bytes than expected on track" when opening some MIDI files

None
closed
nobody
midi (93)
1
2013-12-31
2013-12-31
Markus M
No

Rosegarden fails to load certain (rare) MIDI files, instead giving the "Attempt to get more bytes than expected on track" error. This happens because a few obscure MIDI files have an extra unused padding byte at the very end, thus, by Rosegarden's bookkeeping, after the last event on the track is read there is still a byte left on the track, causing Rosegarden to keep reading, expecting a complete event to be found. This will always fail since a single byte cannot accommodate any event along with its deltatime. Attached is a patch which, instead of reading events strictly until there are no bytes in the track left, allows 1 byte to be left unread; this byte is taken to be padding and is skipped.

1 Attachments

Discussion

  • D. Michael McIntyre

    Committed revision 13604.

     
  • D. Michael McIntyre

    • status: pending --> closed
     

Log in to post a comment.