summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2018-02-11 12:05:23 -0600
committerBen Loftis <ben@harrisonconsoles.com>2018-02-11 12:05:23 -0600
commit0e72ba4b64673746bc9e3b8f13cbd51da92592ae (patch)
tree0444e5277c8185c0fd976c7dd7497abe26e665ed /gtk2_ardour/editor.cc
parent0299229e417ad6b8332ae3c9eafbf67a1c369727 (diff)
Fix potential crash in snap_to_grid (grid-mark list is empty).
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index c56cd94d1d..d911cf648b 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -2710,6 +2710,8 @@ check_best_snap ( samplepos_t presnap, samplepos_t &test, samplepos_t &dist, sam
samplepos_t
Editor::snap_to_grid (vector<ArdourCanvas::Ruler::Mark> marks, samplepos_t presnap, RoundMode direction)
{
+ if (marks.empty() ) return presnap;
+
samplepos_t before;
samplepos_t after;
samplepos_t test;