summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-02 21:37:23 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-02 21:37:23 +0100
commit593dd38514f6ba777c1eef1b065ca7e51e405c7b (patch)
treea51c7c4f3b9b785e40ec1eeabac552679773c576
parentf0db2d5b9cfcbcefad688be6d83fba9fa212b98f (diff)
Fix potential crash.
-rw-r--r--src/subrip_reader.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc
index b95e6be..96526b8 100644
--- a/src/subrip_reader.cc
+++ b/src/subrip_reader.cc
@@ -301,7 +301,7 @@ SubripReader::convert_line(int line_number, string t, RawSubtitle& p)
} else if (has_next(t, i, "</font>")) {
maybe_content (p);
/* Maybe there were no colours, or this is an extra unmatched </font> */
- if (!colours.empty()) {
+ if (colours.size() >= 2) {
colours.pop_back();
p.colour = colours.back();
}