diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-11-22 22:21:17 +0100 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-11-22 22:21:17 +0100 |
commit | 99ed049721302715d4c689114d63d37cff655f02 (patch) | |
tree | 4a5223f85e8aa1351c5ad5813f646329f2bb316d | |
parent | b5b2db8b7c69176157bdda8bfc0bbc4d0a18b329 (diff) | |
download | sherlock.lv2-99ed049721302715d4c689114d63d37cff655f02.tar.xz |
fix first seq counter index and mem overflow.
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | sherlock_nk.c | 12 |
2 files changed, 8 insertions, 6 deletions
@@ -1 +1 @@ -0.11.2727 +0.11.2729 diff --git a/sherlock_nk.c b/sherlock_nk.c index 65233b5..d82c357 100644 --- a/sherlock_nk.c +++ b/sherlock_nk.c @@ -224,7 +224,7 @@ _clear(plughandle_t *handle) _clear_items(handle); nk_str_clear(&handle->str); handle->selected = NULL; - handle->counter = 0; + handle->counter = 1; } void @@ -430,14 +430,16 @@ port_event(LV2UI_Handle instance, uint32_t i, uint32_t size, uint32_t urid, } case 2: { - if(handle->state.block) + const bool overflow = handle->n_item > MAX_LINES; + + if(overflow && handle->state.overwrite) { - break; + _clear(handle); } - if( (handle->n_item > MAX_LINES) && handle->state.overwrite) + if(overflow || handle->state.block) { - _clear(handle); + break; } const LV2_Atom *atom = buf; |