mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-23 21:37:42 -04:00
midifile: correctly write sysex chunks
In midifile we can write sysex continuation chunks starting with 0xf7 but we should not write the trailing 0xf0 byte, if any.
This commit is contained in:
parent
981613075f
commit
2ee3d3e16b
1 changed files with 5 additions and 2 deletions
|
|
@ -557,8 +557,11 @@ int midi_file_write_event(struct midi_file *mf, const struct midi_event *event)
|
|||
if (ev_size > 0 &&
|
||||
(ev_data[0] == 0xf0 || ev_data[0] == 0xf7)) {
|
||||
CHECK_RES(write_n(mf, ev_data, 1));
|
||||
ev_size -= 1;
|
||||
ev_data += 1;
|
||||
ev_size--;
|
||||
ev_data++;
|
||||
|
||||
if (ev_data[ev_size-1] == 0xf0)
|
||||
ev_size--;
|
||||
|
||||
CHECK_RES(write_varlen(mf, tr, ev_size));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue