Skip to content

Commit 152e90b

Browse files
committed
Fix crash in split - thx Leon :)
Fix #9110
1 parent 966ab93 commit 152e90b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
* Ctrl+A not working in subtitle duration field - thx rRobis
4040
* Allow reading Matroska files with ".mp4" extension
4141
* Up max byte size for auto-translate server calls to 128K - thx despairTK
42+
* Make auto-translate setting resizable + a little larger - thx gjaskula
4243
* FIXED:
4344
* Fix for nulling time code after load of sub from mkv
4445
* Fix crash in TTS re-generate - thx cvrle77
@@ -57,6 +58,8 @@
5758
* Fix wrong timestamp (rounding) for format "CSV" - thx MariaB99
5859
* Fix LRC with milliseconds issue - thx AverageHoarder
5960
* Fix crash trying to get subtitles from mp4 - thx nounours18200
61+
* Fix crash in split - thx Leon
62+
* Fix for ffprobe and HDR10 - thx warrentc3
6063

6164

6265
4.0.8 (6th September 2024)

src/ui/Forms/Main.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12181,8 +12181,9 @@ private void SplitSelectedParagraph(double? splitSeconds, int? textIndex, bool a
1218112181
var lines = currentParagraph.Text.SplitToLines();
1218212182
if (textIndex != null)
1218312183
{
12184-
string a = oldText.Substring(0, textIndex.Value).Trim();
12185-
string b = oldText.Substring(textIndex.Value).Trim();
12184+
var ix = Math.Min(oldText.Length, textIndex.Value);
12185+
string a = oldText.Substring(0, ix).Trim();
12186+
string b = oldText.Substring(ix).Trim();
1218612187

1218712188
if (oldText.TrimStart().StartsWith("<i>", StringComparison.Ordinal) && oldText.TrimEnd().EndsWith("</i>", StringComparison.Ordinal) &&
1218812189
Utilities.CountTagInText(oldText, "<i>") == 1 && Utilities.CountTagInText(oldText, "</i>") == 1)

0 commit comments

Comments
 (0)