From 23010a910d63c702a420e0956ddb773b71277ed5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 16 Oct 2022 22:30:35 +0200 Subject: [PATCH] Be liberal about what to accept This addressee a bug where ardour 6 was able to write negative duration `length="-1"` `length-beats="-3.3650500597559585e-05"` Ideally timecnt_t::string_to should check for invalid, negative, duration. But this also catches a more generic case. ``` exception at str.substr (1) #3 Temporal::timepos_t::string_to (this=0x7fffffff7bb0, str="") at libs/temporal/timeline.cc:904 #4 Temporal::timecnt_t::string_to (this=0x7fffffff7ba0, str="-2") at libs/temporal/timeline.cc:294 #5 PBD::string_to (str="-2") at libs/ardour/ardour/types_convert.h:131 ``` --- libs/temporal/timeline.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/temporal/timeline.cc b/libs/temporal/timeline.cc index 60aedb7a02..4910641101 100644 --- a/libs/temporal/timeline.cc +++ b/libs/temporal/timeline.cc @@ -280,6 +280,8 @@ timecnt_t::string_to (std::string const & str) ss >> ticks; _distance = int62_t (true, ticks); break; + default: + return false; } /* eat separator character */