libsmf icon indicating copy to clipboard operation
libsmf copied to clipboard

Robustness

Open jpcima opened this issue 7 years ago • 0 comments

  • fix a buffer overflow in tempo change parsing. test case 16-elo_1977-birmingham_blues-[k].mid.gz
  • fix an assertion raised in the sysex size routine, also used by escape events (F7). fixed also a size check in escape events, which can allow the input to create an invalid size 0 event; unlike sysex, this one does not have an implied status byte. 01-pink_floyd_1975-shine_on_you_crazy_diamond_(part_1).mid.gz
  • fix the case of truncated files, where the track length will extend beyond the file buffer without a check, resulting in a buffer overflow. test case try_get_along.mid.gz
  • fix heap use after free, by stopping after the first track which fails parsing. same file as above
  • in a case when the track does not end with the EOT meta-event, the library can attempt to parse an event from a 0-length buffer, and raise an assertion. 04-mark_knopfler_&_chet_atkins_1990-just_on_time-[demo].mid.gz
  • fix the assertion is_sysex_byte(status) which raises when the sysex or escape event tries to use running status. this is non-standard and libsmf does not support it, so I enforced the check, however some files will use it anyway. test case tmm_Kag_Theme.mid.gz
  • fix the logic error which will let escape events through only if they are invalid.. although it's logical, this may degrade compatibility with non-standard files. if libsmf must support wider cases of escape events, it should implement proper support. test case Main_Lobby.mid.gz
  • fix a memory leak in case of failure in smf_load_from_memory

jpcima avatar Jan 28 '19 06:01 jpcima