blob: 4502d7254f9b66fc359220bc607bdf7a0b406d51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
From 09e5d80286276d4683c944dfa0cddda3479006c0 Mon Sep 17 00:00:00 2001
From: Mladen Milinkovic <maxrd2@smoothware.net>
Date: Thu, 19 Jan 2023 18:39:31 +0100
Subject: [PATCH] Subtitle: fixed crash in splitLines()
---
src/core/subtitle.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/subtitle.cpp b/src/core/subtitle.cpp
index d3da532d..3359062e 100644
--- a/src/core/subtitle.cpp
+++ b/src/core/subtitle.cpp
@@ -541,7 +541,7 @@ Subtitle::splitLines(const RangeList &ranges)
c->insertText(QString(QChar::LineFeed));
return true;
}
- if(text.at(j) == QChar::Space) {
+ if(j < len && text.at(j) == QChar::Space) {
c->movePosition(QTextCursor::Start);
c->movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, j);
c->movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
--
GitLab
|