CoreMIDI MusicSequenceFileLoad segfaults when loading corrupted MIDI file.

Originator:tengyifei88
Number:rdar://35009906 Date Originated:10/17/2017
Status:Open Resolved:
Product:macOS + SDK Product Version:10.13 Build 17A405
Classification:Bug Reproducible:Yes
 
Summary: CoreMIDI MusicSequenceFileLoad segfaults when loading corrupted MIDI file. There is no chance for recovery.


Steps to Reproduce:

Project for purpose of reproduction: https://github.com/tengyifei/CoreMIDI-Segfault

Load the MIDI file using MusicSequenceLoadFlags.smf_PreserveTracks as flags. The file and the playground is supplied with the accompanying archive.

Expected Results:
MusicSequenceFileLoad returns with an error.

Actual Results:
App crashes with the error "660:  Zero-velocity note on should not be here" at SequenceTrack::ReadMidiFileTrack(TStream&)

Version/Build: OS X 10.13 Build 17A405


Configuration: Debug

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!