From 630587ee3f59ebe98ccd9dcd015c4a20677b6f7a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 30 Jun 2024 23:07:29 +0200 Subject: [PATCH] VST2: amend prev commit, ignore SysEx and invalid MIDI events --- libs/ardour/session_vst.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index b44c4a5ad6..2374ccf4d9 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -302,11 +302,12 @@ intptr_t Session::vst_callback ( VstEvents* v = (VstEvents*)ptr; for (int n = 0 ; n < v->numEvents; ++n) { VstMidiEvent *vme = (VstMidiEvent*) (v->events[n]->dump); - if (vme->type == kVstMidiType) { + int size = Evoral::midi_event_size((uint8_t)vme->midiData[0]); + if (vme->type == kVstMidiType && size > 0) { plug->midi_buffer()->push_back( vme->deltaSamples, Evoral::MIDI_EVENT, - Evoral::midi_event_size((uint8_t)vme->midiData[0]), + size, (uint8_t*)vme->midiData ); }