hq9000/cython-vst-loader

a crash when more than 2 midi events are in the buffer

hq9000 opened this issue · 1 comments

it looks like something weid happens when we pass more than 1 event to the "process events" callback.

in that situation, it was a note start, note end. when inspecting what actually arrives to the plugin, i saw that the first event was actually the "note off" one (i'd expect it to be note on, as it was put to the list first).

The second element in that array seems to contain some garbage (uninig memory).

This suggest that somewhere in the loader we have some "off by one" error

  • add a header to declare struct VstEvents1024

struct VstEvents1024
{
//-------------------------------------------------------------------------------------------------------
	VstInt32 numEvents;		///< number of Events in array
	VstIntPtr reserved;		///< zero (Reserved for future use)
	VstEvent* events[1024];	///< event pointer array, variable size
//-------------------------------------------------------------------------------------------------------
};