diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-10-22 12:17:59 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-10-22 17:07:11 -0400 |
commit | 5ff0c6b319ef89deaeeb1a2cb387ec159df85172 (patch) | |
tree | d2054fb64890f8d8ddb91171173dca2614f27125 | |
parent | 3ddd797e46b232235deb8d79c34b40f35bb2153b (diff) |
prevent negative playhead positions from entering code via serialized state
-rw-r--r-- | gtk2_ardour/editor.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index bf6b9bd021..eaf55bcc1c 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2203,7 +2203,12 @@ Editor::set_state (const XMLNode& node, int /*version*/) if (_session && (prop = node.property ("playhead"))) { framepos_t pos; sscanf (prop->value().c_str(), "%" PRIi64, &pos); - playhead_cursor->set_position (pos); + if (pos >= 0) { + playhead_cursor->set_position (pos); + } else { + warning << _("Playhead position stored with a negative value - ignored (use zero instead)") << endmsg; + playhead_cursor->set_position (0); + } } else { playhead_cursor->set_position (0); } |