summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-18 02:22:44 -0500
committerDavid Robillard <d@drobilla.net>2014-11-18 02:53:27 -0500
commitaabde88de0b22e029de394e2d23daa5a0be93650 (patch)
treec06fb275a3040c011b308a38ebefa207f0a5a4eb /gtk2_ardour/editor_ops.cc
parent2c85e7acac4a6193e9ae8cae19c0b16bba9789d6 (diff)
Fix incredibly unlikely NULL pointer dereference.
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 47e24470c4..a7e6d8420f 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -4386,7 +4386,7 @@ Editor::paste_internal (framepos_t position, float times)
sort_track_selection (ts);
} else {
/* Figure out which track to base the paste at. */
- TimeAxisView* base_track;
+ TimeAxisView* base_track = NULL;
if (_edit_point == Editing::EditAtMouse && entered_track) {
/* With the mouse edit point, paste onto the track under the mouse. */
base_track = entered_track;
@@ -4396,6 +4396,9 @@ Editor::paste_internal (framepos_t position, float times)
} else if (_last_cut_copy_source_track) {
/* Paste to the track that the cut/copy came from (see mantis #333). */
base_track = _last_cut_copy_source_track;
+ } else {
+ /* This is "impossible" since we've copied... well, do nothing. */
+ return;
}
/* Walk up to parent if necessary, so base track is a route. */