InvisibleWrench/FlutterMidiCommand

Buffer overwrite - MacOS & iOS

Donkermand opened this issue · 0 comments

In SwiftFlutterMidiCommandPlugin.swift - parseData method:

As part of handling a sysex message, it is handed over to the main thread using: DispatchQueue.main.async.
A local buffer is used for the sysex data: self.sysExBuffer.

A newer sysex package can overwrite this buffer before it is handled by the main thread.

A simple fix would be to make a copy of the data before handing it over to the main thread.

Best regards John Parbo Andersen