From 9908419f890bae2299eafbba6d2d7d4e145df681 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 12 May 2020 19:30:15 +0200 Subject: [PATCH] Use byte-offset when reading size at ringbuffer boundary This likely fixes https://github.com/sfztools/sfizz/issues/221 --- libs/ardour/worker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/worker.cc b/libs/ardour/worker.cc index 73d4e1de83..1360b77b74 100644 --- a/libs/ardour/worker.cc +++ b/libs/ardour/worker.cc @@ -108,7 +108,7 @@ Worker::verify_message_completeness(PBD::RingBuffer* rb) memcpy (&size, vec.buf[0], sizeof (size)); } else { memcpy (&size, vec.buf[0], vec.len[0]); - memcpy (&size + vec.len[0], vec.buf[1], sizeof(size) - vec.len[0]); + memcpy (& reinterpret_cast(&size)[vec.len[0]], vec.buf[1], sizeof(size) - vec.len[0]); } if (read_space < size+sizeof(size)) { /* message from writer is yet incomplete. respond next cycle */