summaryrefslogtreecommitdiff
path: root/src/subrip_reader.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-29 22:33:33 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-29 22:33:33 +0000
commit23d4d5df719e020011686ff9225845ae360f408e (patch)
tree84e2b40b72b602c86d33e6711d7ac45b7a79fc2f /src/subrip_reader.cc
parent149f2cab4d14c4bc801c168f64d259c1f67deb9a (diff)
Fix crash on malformed SubRip file (dcpomatic #1454).
Diffstat (limited to 'src/subrip_reader.cc')
-rw-r--r--src/subrip_reader.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc
index b5d0446..5625679 100644
--- a/src/subrip_reader.cc
+++ b/src/subrip_reader.cc
@@ -156,6 +156,9 @@ SubripReader::convert_time (string t)
vector<string> b;
boost::algorithm::split (b, a[2], boost::is_any_of (","));
+ if (b.size() != 2) {
+ throw SubripError (t, "time in the format h:m:s,ms", _context);
+ }
return Time::from_hms (
lexical_cast<int> (a[0]),