From 4ea289ba2700f2cda1b06b117c43807f9ec92f89 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 11 Apr 2021 17:23:55 -0700 Subject: [PATCH] MIDI: Reject files with no event data --- Plugins/MIDI/MIDI/MIDIDecoder.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Plugins/MIDI/MIDI/MIDIDecoder.mm b/Plugins/MIDI/MIDI/MIDIDecoder.mm index 802be17db..681a3423b 100755 --- a/Plugins/MIDI/MIDI/MIDIDecoder.mm +++ b/Plugins/MIDI/MIDI/MIDIDecoder.mm @@ -60,6 +60,9 @@ static OSType getOSType(const char * in_) if ( !midi_processor::process_file(file_data, [[[s url] pathExtension] UTF8String], midi_file) ) return NO; + if ( !midi_file.get_timestamp_end( track_num ) ) + return NO; + track_num = [[[s url] fragment] intValue]; //What if theres no fragment? Assuming we get 0. midi_file.scan_for_loops( true, true, true, true );