From 0e999f34e128a2f758f68da52dae827f40db648a Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 30 Oct 2022 19:52:04 +0000 Subject: [PATCH] Fix infinite loop when receiving midi message over 4 bytes in size Signed-off-by: falkTX --- plugins/Nekobi/DistrhoPluginNekobi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/Nekobi/DistrhoPluginNekobi.cpp b/plugins/Nekobi/DistrhoPluginNekobi.cpp index d652f2b..f405969 100644 --- a/plugins/Nekobi/DistrhoPluginNekobi.cpp +++ b/plugins/Nekobi/DistrhoPluginNekobi.cpp @@ -373,13 +373,12 @@ void DistrhoPluginNekobi::run(const float**, float** outputs, uint32_t frames, c fSynth.nugget_remains = XSYNTH_NUGGET_SIZE; /* process any ready events */ - while (curEventIndex < midiEventCount && framesDone == midiEvents[curEventIndex].frame) + for (; curEventIndex < midiEventCount && framesDone == midiEvents[curEventIndex].frame; ++curEventIndex) { if (midiEvents[curEventIndex].size > MidiEvent::kDataSize) continue; nekobee_handle_raw_event(&fSynth, midiEvents[curEventIndex].size, midiEvents[curEventIndex].data); - curEventIndex++; } /* calculate the sample count (burstSize) for the next nekobee_voice_render() call to be the smallest of: