diff options
author | David Robillard <d@drobilla.net> | 2022-05-27 14:01:22 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-05-27 14:01:22 -0400 |
commit | 569a1e046ab959eda50543d4ccfdc94a9dfe62f0 (patch) | |
tree | 71620e2f39033e5c4064ed7a5dda29a8d1fb8b94 | |
parent | d22bd43dd053b060dfce40285cd968602efbce78 (diff) | |
download | jalv-569a1e046ab959eda50543d4ccfdc94a9dfe62f0.tar.gz jalv-569a1e046ab959eda50543d4ccfdc94a9dfe62f0.tar.bz2 jalv-569a1e046ab959eda50543d4ccfdc94a9dfe62f0.zip |
Gracefully handle attempt to schedule work with size 0
-rw-r--r-- | src/worker.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/worker.c b/src/worker.c index 5192066..476c11f 100644 --- a/src/worker.c +++ b/src/worker.c @@ -115,6 +115,11 @@ jalv_worker_schedule(LV2_Worker_Schedule_Handle handle, { JalvWorker* worker = (JalvWorker*)handle; Jalv* jalv = worker->jalv; + + if (!size) { + return LV2_WORKER_ERR_UNKNOWN; + } + if (worker->threaded) { // Schedule a request to be executed by the worker thread zix_ring_write(worker->requests, (const char*)&size, sizeof(size)); @@ -127,6 +132,7 @@ jalv_worker_schedule(LV2_Worker_Schedule_Handle handle, jalv->instance->lv2_handle, jalv_worker_respond, worker, size, data); zix_sem_post(&jalv->work_lock); } + return LV2_WORKER_SUCCESS; } |