13
0

fix edge case (partial write of LV2 worker message size)

This commit is contained in:
Robin Gareus 2014-03-23 00:04:46 +01:00
parent a87a71f05f
commit 679d48ee2b

View File

@ -82,6 +82,9 @@ Worker::verify_message_completeness(RingBuffer<uint8_t>* rb)
uint32_t size;
RingBuffer<uint8_t>::rw_vector vec;
rb->get_read_vector (&vec);
if (vec.len[0] + vec.len[1] < sizeof(size)) {
return false;
}
if (vec.len[0] >= sizeof(size)) {
memcpy (&size, vec.buf[0], sizeof (size));
} else {