Use byte-offset when reading size at ringbuffer boundary
This likely fixes https://github.com/sfztools/sfizz/issues/221
This commit is contained in:
parent
ab6e274613
commit
9908419f89
@ -108,7 +108,7 @@ Worker::verify_message_completeness(PBD::RingBuffer<uint8_t>* rb)
|
|||||||
memcpy (&size, vec.buf[0], sizeof (size));
|
memcpy (&size, vec.buf[0], sizeof (size));
|
||||||
} else {
|
} else {
|
||||||
memcpy (&size, vec.buf[0], vec.len[0]);
|
memcpy (&size, vec.buf[0], vec.len[0]);
|
||||||
memcpy (&size + vec.len[0], vec.buf[1], sizeof(size) - vec.len[0]);
|
memcpy (& reinterpret_cast<uint8_t*>(&size)[vec.len[0]], vec.buf[1], sizeof(size) - vec.len[0]);
|
||||||
}
|
}
|
||||||
if (read_space < size+sizeof(size)) {
|
if (read_space < size+sizeof(size)) {
|
||||||
/* message from writer is yet incomplete. respond next cycle */
|
/* message from writer is yet incomplete. respond next cycle */
|
||||||
|
Loading…
Reference in New Issue
Block a user