summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-11-19 20:03:14 +0100
committerCarl Hetherington <cth@carlh.net>2025-11-19 20:03:14 +0100
commitf3636332da1b1d0c29865d5eb76675d4af420257 (patch)
tree3ce004300bf49b4cdd723c356af5810b2bc9da3c /src
parentabb7bb7cf33b689433b2dac0c55d637fa52728bf (diff)
Tolerate superfluous </font> tags in subrip.v1.6.58
Diffstat (limited to 'src')
-rw-r--r--src/subrip_reader.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc
index 73af9ee..0e948f9 100644
--- a/src/subrip_reader.cc
+++ b/src/subrip_reader.cc
@@ -298,9 +298,11 @@ SubripReader::convert_line (string t, RawSubtitle& p)
}
} else if (has_next(t, i, "</font>")) {
maybe_content (p);
- SUB_ASSERT (!colours.empty());
- colours.pop_back ();
- p.colour = colours.back ();
+ /* Maybe there were no colours, or this is an extra unmatched </font> */
+ if (!colours.empty()) {
+ colours.pop_back();
+ p.colour = colours.back();
+ }
} else if (has_next(t, i, "{\\")) {
string ssa = "\\";
while (i < t.size() && t[i] != '}') {