Fix sending out of bounds events to LV2 plugins.
authorDavid Robillard <d@drobilla.net>
Thu, 5 Feb 2015 22:37:17 +0000 (17:37 -0500)
committerDavid Robillard <d@drobilla.net>
Mon, 9 Feb 2015 18:45:37 +0000 (13:45 -0500)
libs/ardour/lv2_plugin.cc

index 5a97bfa41f6b26713e06dea858b7ed979a4c933b..7f744be3d6e89c63639ac0c7bcce3be6e98d9eb9 100644 (file)
@@ -2012,7 +2012,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
                                LV2_Evbuf*            buf  = _ev_buffers[msg.index];
                                LV2_Evbuf_Iterator    i    = lv2_evbuf_end(buf);
                                const LV2_Atom* const atom = (const LV2_Atom*)&body[0];
-                               if (!lv2_evbuf_write(&i, nframes, 0, atom->type, atom->size,
+                               if (!lv2_evbuf_write(&i, nframes - 1, 0, atom->type, atom->size,
                                                (const uint8_t*)(atom + 1))) {
                                        error << "Failed to write data to LV2 event buffer\n";
                                }