From 8cb09ab2cfc87f20f00927f955cc58416525df32 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 5 May 2021 18:33:37 -0600 Subject: [PATCH] fix for region-drag to the dropzone (#8672) The DraggingView's time_axis_view (index) is set to the size of _time_axis_views in ::motion() near line 1149. This makes it invalid as index into the vector. --- gtk2_ardour/editor_drag.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index b8b1359e3e..855ebf8b66 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1467,14 +1467,20 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred) bool const changed_position = (_last_position.sample != _primary->region()->position()); bool changed_tracks; - if (_views.front().time_axis_view < 0) { - if (&_views.front().view->get_time_axis_view()) { - changed_tracks = true; - } else { - changed_tracks = false; - } + if (_views.front().time_axis_view == _time_axis_views.size()) { + /* in the drop zone */ + changed_tracks = true; } else { - changed_tracks = (_time_axis_views[_views.front().time_axis_view] != &_views.front().view->get_time_axis_view()); + + if (_views.front().time_axis_view < 0) { + if (&_views.front().view->get_time_axis_view()) { + changed_tracks = true; + } else { + changed_tracks = false; + } + } else { + changed_tracks = (_time_axis_views[_views.front().time_axis_view] != &_views.front().view->get_time_axis_view()); + } } if (_copy) {