diff options
author | David Robillard <d@drobilla.net> | 2013-06-08 18:13:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-06-08 18:13:38 +0000 |
commit | b5ff339e2c3dfc8ad4d73c21b6887a58a6c71c9d (patch) | |
tree | bc17c25da770a6ede18af63a91b786de9907f72f /src | |
parent | 3501582c83f9abe27cc23a6a0526d1ddfa4138d9 (diff) | |
download | jalv-b5ff339e2c3dfc8ad4d73c21b6887a58a6c71c9d.tar.gz jalv-b5ff339e2c3dfc8ad4d73c21b6887a58a6c71c9d.tar.bz2 jalv-b5ff339e2c3dfc8ad4d73c21b6887a58a6c71c9d.zip |
Fix potential ringbuffer race for UI events.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5124 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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)); |