summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-05-12 19:30:15 +0200
committerRobin Gareus <robin@gareus.org>2020-05-12 19:30:15 +0200
commit9908419f890bae2299eafbba6d2d7d4e145df681 (patch)
treec34588c83254adf9bf22676485a257c1e3b5d47f /libs
parentab6e274613d33506997ee4e4b91f3d6423417af7 (diff)
Use byte-offset when reading size at ringbuffer boundary
This likely fixes https://github.com/sfztools/sfizz/issues/221
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/worker.cc2
1 files changed, 1 insertions, 1 deletions
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<uint8_t>* 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<uint8_t*>(&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 */