Skip to content

Commit

Permalink
Fix infinite loop when receiving midi message over 4 bytes in size
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Oct 30, 2022
1 parent 58339d4 commit 0e999f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/Nekobi/DistrhoPluginNekobi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0e999f3

Please sign in to comment.