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 ) {