Skip to content

Commit

Permalink
Do not assert/crash when bad clients send unordered events
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Aug 18, 2018
1 parent 341f54f commit fb87a14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/JackMidiPort.cpp
@@ -1,5 +1,6 @@
/*
Copyright (C) 2007 Dmitry Baikov
Copyright (C) 2018 Filipe Coelho
Original JACK MIDI implementation Copyright (C) 2004 Ian Esten
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -130,7 +131,10 @@ static void MidiBufferMixdown(void* mixbuffer, void** src_buffers, int src_count
next_buf_index = i;
}
}
assert(next_event != 0);
if (next_event == 0) {
jack_error("Jack::MidiBufferMixdown - got invalid next event");
break;
}

// write the event
jack_midi_data_t* dest = mix->ReserveEvent(next_event->time, next_event->size);
Expand Down

0 comments on commit fb87a14

Please sign in to comment.