There seems to be an issue with the current implementation of reading incoming SysEx: Iterating over vst::api::Events::events() produces SysExEvents that contain bytes as payload which are not the sys-ex bytes to be expected.
As far as I can tell, the problem is that the iterator creates copies of vst::api::Event values. On 64-bit systems, the vst::api::Event struct is smaller than the vst::api::SysExEvent struct: The _reserved field of vst::api::Event is 16 bytes large whereas the 4 last fields of vst::api::SysExEvent (the counterpart of _reserved) have a size of in total 1 4 + 3 8 = 28 bytes. When creating a copy of vst::api::Event, these extra bytes are just skipped. Result: When the copy is casted back to vst::api::SysExEvent, the system_data pointer will contain arbitrary data. Dereferencing it will deliver unexpected results.
There seems to be an issue with the current implementation of reading incoming SysEx: Iterating over
vst::api::Events::events()
producesSysExEvent
s that contain bytes aspayload
which are not the sys-ex bytes to be expected.As far as I can tell, the problem is that the iterator creates copies of
vst::api::Event
values. On 64-bit systems, thevst::api::Event
struct is smaller than thevst::api::SysExEvent
struct: The_reserved
field ofvst::api::Event
is 16 bytes large whereas the 4 last fields ofvst::api::SysExEvent
(the counterpart of_reserved
) have a size of in total 1 4 + 3 8 = 28 bytes. When creating a copy ofvst::api::Event
, these extra bytes are just skipped. Result: When the copy is casted back tovst::api::SysExEvent
, thesystem_data
pointer will contain arbitrary data. Dereferencing it will deliver unexpected results.Tested in REAPER on Windows x64.
PR on the way.