aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jalv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 946f98e..f174eb1 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -746,7 +746,9 @@ jalv_emit_ui_events(Jalv* jalv)
{
ControlChange ev;
const size_t space = jack_ringbuffer_read_space(jalv->plugin_events);
- for (size_t i = 0; i < space; i += sizeof(ev) + ev.size) {
+ for (size_t i = 0;
+ i + sizeof(ev) + sizeof(float) <= space;
+ i += sizeof(ev) + ev.size) {
// Read event header to get the size
jack_ringbuffer_read(jalv->plugin_events, (char*)&ev, sizeof(ev));