diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-17 09:56:46 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-17 09:56:46 +0200 |
commit | 674e3694ac724b1bed475e60c0ab70139ceba286 (patch) | |
tree | db1789bf545888a035561cb6f317eb7be676c803 | |
parent | 3cc158998d18822ac253ef3eae9bf182df1b1d38 (diff) |
Fix event body size.
-rw-r--r-- | test/lv2_test_host.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/lv2_test_host.cc b/test/lv2_test_host.cc index 07685d0..375ae40 100644 --- a/test/lv2_test_host.cc +++ b/test/lv2_test_host.cc @@ -166,10 +166,11 @@ void LV2TestHost::Sequence::clear() // Keep this to support atom extension from lv2 < 1.10 static inline LV2_Atom_Event* _lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq, - uint32_t capacity, - const LV2_Atom_Event* event) + uint32_t capacity, + const LV2_Atom_Event* event) { const uint32_t total_size = (uint32_t)sizeof(*event) + event->body.size; + if (capacity - seq->atom.size < total_size) { return NULL; } @@ -195,7 +196,7 @@ void LV2TestHost::Sequence::addMidiNote(uint64_t pos, MIDINoteEvent ev; ev.event.time.frames = pos;// sample position ev.event.body.type = map.map(map.handle, LV2_MIDI__MidiEvent); - ev.event.body.size = sizeof(MIDINoteEvent); + ev.event.body.size = sizeof(ev.msg); ev.msg[0] = note_on; ev.msg[1] = key; |