summaryrefslogtreecommitdiff
path: root/src/ssa_reader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssa_reader.cc')
-rw-r--r--src/ssa_reader.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc
index 471931f..b899da6 100644
--- a/src/ssa_reader.cc
+++ b/src/ssa_reader.cc
@@ -212,9 +212,11 @@ SSAReader::parse_line (RawSubtitle base, string line, int play_res_x, int play_r
/* Count the number of line breaks */
int line_breaks = 0;
- for (size_t i = 0; i < line.length() - 1; ++i) {
- if (line[i] == '\\' && (line[i+1] == 'n' || line[i+1] == 'N')) {
- ++line_breaks;
+ if (line.length() > 1) {
+ for (size_t i = 0; i < line.length() - 1; ++i) {
+ if (line[i] == '\\' && (line[i+1] == 'n' || line[i+1] == 'N')) {
+ ++line_breaks;
+ }
}
}