13
0

likely fix for crash in MidiBuffer::merge_in_place() due to unwarranted assumption in the code

git-svn-id: svn://localhost/ardour2/branches/3.0@11051 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-12-21 18:10:58 +00:00
parent 8d05ed8e8a
commit 302ac289ba

View File

@ -506,6 +506,16 @@ MidiBuffer::merge_in_place(const MidiBuffer &other)
} else if (them != other.end()) { } else if (them != other.end()) {
if ((*us).time() < ((*them).time())) {
/* just append the rest of other */
memcpy (_data + us.offset, other._data + them.offset, other._size - them.offset);
_size += other._size - them.offset;
assert(_size <= _capacity);
break;
}
/* to get here implies that we've encountered two /* to get here implies that we've encountered two
* messages with the same timestamp. we must order * messages with the same timestamp. we must order
* them correctly. * them correctly.