summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-09 15:58:18 +0000
committerDavid Robillard <d@drobilla.net>2008-05-09 15:58:18 +0000
commitedf088a15d74ace22c7bf12a160caf98d31fa1d8 (patch)
treef3d45369c8c7bd4ed7de8a8269d0f11237f7620b /src/libs
parent85973d1a800fd1a542c69feb1be80b6da309ace8 (diff)
downloadingen-edf088a15d74ace22c7bf12a160caf98d31fa1d8.tar.gz
ingen-edf088a15d74ace22c7bf12a160caf98d31fa1d8.tar.bz2
ingen-edf088a15d74ace22c7bf12a160caf98d31fa1d8.zip
Fix crash when receiving Jack MIDI events.
git-svn-id: http://svn.drobilla.net/lad/ingen@1204 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/engine/EventBuffer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libs/engine/EventBuffer.cpp b/src/libs/engine/EventBuffer.cpp
index 2173551a..d11989ab 100644
--- a/src/libs/engine/EventBuffer.cpp
+++ b/src/libs/engine/EventBuffer.cpp
@@ -161,9 +161,11 @@ EventBuffer::append(uint32_t frames,
const uint8_t* data)
{
#ifndef NDEBUG
- LV2_Event* last_event = lv2_event_get(&_iter, NULL);
- assert(last_event->frames < frames
- || (last_event->frames == frames && last_event->subframes <= subframes));
+ if (lv2_event_is_valid(&_iter)) {
+ LV2_Event* last_event = lv2_event_get(&_iter, NULL);
+ assert(last_event->frames < frames
+ || (last_event->frames == frames && last_event->subframes <= subframes));
+ }
#endif
bool ret = lv2_event_write(&_iter, frames, subframes, type, size, data);