mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-09 15:15:41 +01:00
Fix erasing events in MIDIBuffer
When the last event in a MIDI buffer was erased, the whole buffer was assumed to be empty (bug introduced in 7.5-96-gc5511040ec)
This commit is contained in:
parent
066df7cc1a
commit
c3b55240b1
1 changed files with 7 additions and 1 deletions
|
|
@ -153,12 +153,18 @@ public:
|
|||
|
||||
size_t total_data_deleted = align32 (sizeof(TimeType) + sizeof (Evoral::EventType) + event_size);
|
||||
|
||||
if (i.offset + total_data_deleted >= _size) {
|
||||
if (total_data_deleted >= _size) {
|
||||
_size = 0;
|
||||
_silent = true;
|
||||
return end();
|
||||
}
|
||||
|
||||
if (i.offset + total_data_deleted >= _size) {
|
||||
assert (_size > total_data_deleted);
|
||||
_size -= total_data_deleted;
|
||||
return end();
|
||||
}
|
||||
|
||||
/* we need to avoid the temporary malloc that memmove would do,
|
||||
so copy by hand. remember: this is small amounts of data ...
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue