aboutsummaryrefslogtreecommitdiffstats
path: root/lv2/lv2plug.in/ns/ext/event/event-helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'lv2/lv2plug.in/ns/ext/event/event-helpers.h')
-rw-r--r--lv2/lv2plug.in/ns/ext/event/event-helpers.h5
1 files changed, 4 insertions, 1 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;