From 9ec88674048c4d4d82383623b38c31927340143d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 9 Feb 2010 20:49:36 +0000 Subject: Fix port value broadcasting to work with all types. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2438 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/ObjectBuffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/engine/ObjectBuffer.cpp') diff --git a/src/engine/ObjectBuffer.cpp b/src/engine/ObjectBuffer.cpp index a391bb99..a4108ba1 100644 --- a/src/engine/ObjectBuffer.cpp +++ b/src/engine/ObjectBuffer.cpp @@ -41,7 +41,7 @@ using namespace Shared; ObjectBuffer::ObjectBuffer(BufferFactory& factory, size_t capacity) : Buffer(factory, PortType(PortType::VALUE), capacity) { - assert(capacity >= sizeof(LV2_Object)); + capacity += sizeof(LV2_Object); #ifdef HAVE_POSIX_MEMALIGN const int ret = posix_memalign((void**)&_buf, 16, capacity); @@ -88,7 +88,7 @@ ObjectBuffer::resize(size_t size) const uint32_t contents_size = sizeof(LV2_Object) + _buf->size; _buf = (LV2_Object*)realloc(_buf, sizeof(LV2_Object) + size); - _size = size; + _size = size + sizeof(LV2_Object); // If we shrunk and chopped the current contents, clear corrupt data if (size < contents_size) -- cgit v1.2.1