Fix crash on trying to snap to markers when there aren't
authorCarl Hetherington <carl@carlh.net>
Wed, 4 Jul 2012 21:53:44 +0000 (21:53 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 4 Jul 2012 21:53:44 +0000 (21:53 +0000)
any (#4988).

git-svn-id: svn://localhost/ardour2/branches/3.0@12989 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc

index b85d28beb5f8c1ca966e1e7f7b61a804657a8fa3..6be3b3c4efcca15d70f5f45dc9f8aa3fa211e691 100644 (file)
@@ -2743,7 +2743,10 @@ Editor::snap_to_internal (framepos_t& start, int32_t direction, bool for_mark)
 
                _session->locations()->marks_either_side (start, before, after);
 
-               if (before == max_framepos) {
+               if (before == max_framepos && after == max_framepos) {
+                       /* No marks to snap to, so just don't snap */
+                       return;
+               } else if (before == max_framepos) {
                        start = after;
                } else if (after == max_framepos) {
                        start = before;