diff options
author | David Robillard <d@drobilla.net> | 2012-07-02 16:21:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-07-02 16:21:31 +0000 |
commit | 360399998b3dbacd12d8b8a79f2a97e54be6d43f (patch) | |
tree | 81f3e7d3ad52b52c966730367c421367223c5db7 /lv2/lv2plug.in/ns/ext | |
parent | 614420471551f48ede7e829a62e008547f3c116b (diff) | |
download | lv2-360399998b3dbacd12d8b8a79f2a97e54be6d43f.tar.xz |
Make event iterator gracefully handle optional ports.
Diffstat (limited to 'lv2/lv2plug.in/ns/ext')
-rw-r--r-- | lv2/lv2plug.in/ns/ext/event/event-helpers.h | 5 | ||||
-rw-r--r-- | lv2/lv2plug.in/ns/ext/event/event.ttl | 9 | ||||
-rw-r--r-- | lv2/lv2plug.in/ns/ext/event/manifest.ttl | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/lv2/lv2plug.in/ns/ext/event/event-helpers.h b/lv2/lv2plug.in/ns/ext/event/event-helpers.h index 46d634d..8e29507 100644 --- a/lv2/lv2plug.in/ns/ext/event/event-helpers.h +++ b/lv2/lv2plug.in/ns/ext/event/event-helpers.h @@ -108,7 +108,7 @@ lv2_event_begin(LV2_Event_Iterator* iter, static inline bool lv2_event_is_valid(LV2_Event_Iterator* iter) { - return (iter->offset < iter->buf->size); + return (iter->buf && (iter->offset < iter->buf->size)); } @@ -165,6 +165,9 @@ lv2_event_write(LV2_Event_Iterator* iter, uint16_t size, const uint8_t* data) { + if (!iter->buf) + return false; + if (iter->buf->capacity - iter->buf->size < sizeof(LV2_Event) + size) return false; diff --git a/lv2/lv2plug.in/ns/ext/event/event.ttl b/lv2/lv2plug.in/ns/ext/event/event.ttl index e6a11a3..971fce2 100644 --- a/lv2/lv2plug.in/ns/ext/event/event.ttl +++ b/lv2/lv2plug.in/ns/ext/event/event.ttl @@ -17,6 +17,15 @@ <event-helpers.h> , <../../meta/meta.ttl> ; doap:release [ + doap:revision "1.7" ; + doap:created "2012-07-02" ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make event iterator gracefully handle optional ports." + ] + ] + ] , [ doap:revision "1.6" ; doap:created "2012-04-17" ; doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ; diff --git a/lv2/lv2plug.in/ns/ext/event/manifest.ttl b/lv2/lv2plug.in/ns/ext/event/manifest.ttl index 2b21906..27882bf 100644 --- a/lv2/lv2plug.in/ns/ext/event/manifest.ttl +++ b/lv2/lv2plug.in/ns/ext/event/manifest.ttl @@ -4,6 +4,6 @@ <http://lv2plug.in/ns/ext/event> a lv2:Specification ; lv2:minorVersion 1 ; - lv2:microVersion 6 ; + lv2:microVersion 7 ; rdfs:seeAlso <event.ttl> . |