Fix heap-use-after-free when drawing automation events

When drawing over existing automation it can happen that the
range that is being replaced is currently being in the lookup
cache.
This commit is contained in:
Robin Gareus
2026-01-10 03:42:51 +01:00
parent b4ba3d2b9f
commit 2bfdbc161b

View File

@@ -739,7 +739,13 @@ ControlList::editor_add_ordered (OrderedPoints const & points, bool with_guard)
timecnt_t distance = earliest.distance (latest); timecnt_t distance = earliest.distance (latest);
(void) erase_range_internal (earliest, latest, _events); if (erase_range_internal (earliest, latest, _events)) {
/* invalidate lookup cache
* This is required since add_guard_point () may use the
* cache to determine the value.
*/
mark_dirty ();
}
if (with_guard) { if (with_guard) {
unlocked_invalidate_insert_iterator (); unlocked_invalidate_insert_iterator ();