summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfalkTX <falktx@gmail.com>2018-08-18 14:29:57 +0200
committerfalkTX <falktx@gmail.com>2018-08-18 14:29:57 +0200
commitfb87a14b3e153d0cba6af0b3262bcc3c9fe83ce7 (patch)
tree787610b2725631da1e050e205de2695a6b93414e
parent341f54ff79a69afdc39741358f6d8886ba2f3a0d (diff)
downloadjack2-fb87a14b3e153d0cba6af0b3262bcc3c9fe83ce7.tar.gz
Do not assert/crash when bad clients send unordered events
-rw-r--r--common/JackMidiPort.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/JackMidiPort.cpp b/common/JackMidiPort.cpp
index babee324..8731f1e1 100644
--- a/common/JackMidiPort.cpp
+++ b/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
@@ -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);