mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-04 15:10:20 +00:00
jack: copy events to right offset
The larger events need to be copied into the target buffer at the same offset as the source buffer or else we overwrite the header and make a corrupt buffer.
This commit is contained in:
parent
89edb9f6c5
commit
cdc150a2c3
|
@ -5356,7 +5356,7 @@ static void *get_buffer_input_midi(struct port *p, jack_nframes_t frames)
|
|||
* sizeof(struct midi_event)));
|
||||
if (mb->write_pos) {
|
||||
size_t offs = mb->buffer_size - 1 - mb->write_pos;
|
||||
memcpy(ptr, SPA_PTROFF(mb, offs, void), mb->write_pos);
|
||||
memcpy(SPA_PTROFF(ptr, offs, void), SPA_PTROFF(mb, offs, void), mb->write_pos);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue