From 026380fe40f84d51a9b40b047b7529765c5214f8 Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Mon, 9 May 2016 21:56:44 -0700 Subject: [PATCH] Now MIDI decoder will stop playing if init/startup fails, rather than attempting to play with no SoundFonts loaded. --- Plugins/MIDI/MIDI/MIDIDecoder.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugins/MIDI/MIDI/MIDIDecoder.mm b/Plugins/MIDI/MIDI/MIDIDecoder.mm index 8d7635a53..0ab1acae1 100755 --- a/Plugins/MIDI/MIDI/MIDIDecoder.mm +++ b/Plugins/MIDI/MIDI/MIDIDecoder.mm @@ -245,7 +245,8 @@ static OSType getOSType(const char * in_) soundFontsAssigned = YES; } - player->Play( (float *) buf, frames ); + if ( player->Play( (float *) buf, frames ) < frames ) + return -1; if ( !repeatone && framesRead + frames > localFramesLength ) { if ( framesFade ) {