Skip to content

Commit

Permalink
Fix crash in split - thx Leon :)
Browse files Browse the repository at this point in the history
Fix #9110
  • Loading branch information
niksedk committed Dec 19, 2024
1 parent 966ab93 commit 152e90b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* Ctrl+A not working in subtitle duration field - thx rRobis
* Allow reading Matroska files with ".mp4" extension
* Up max byte size for auto-translate server calls to 128K - thx despairTK
* Make auto-translate setting resizable + a little larger - thx gjaskula
* FIXED:
* Fix for nulling time code after load of sub from mkv
* Fix crash in TTS re-generate - thx cvrle77
Expand All @@ -57,6 +58,8 @@
* Fix wrong timestamp (rounding) for format "CSV" - thx MariaB99
* Fix LRC with milliseconds issue - thx AverageHoarder
* Fix crash trying to get subtitles from mp4 - thx nounours18200
* Fix crash in split - thx Leon
* Fix for ffprobe and HDR10 - thx warrentc3


4.0.8 (6th September 2024)
Expand Down
5 changes: 3 additions & 2 deletions src/ui/Forms/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12181,8 +12181,9 @@ private void SplitSelectedParagraph(double? splitSeconds, int? textIndex, bool a
var lines = currentParagraph.Text.SplitToLines();
if (textIndex != null)
{
string a = oldText.Substring(0, textIndex.Value).Trim();
string b = oldText.Substring(textIndex.Value).Trim();
var ix = Math.Min(oldText.Length, textIndex.Value);
string a = oldText.Substring(0, ix).Trim();
string b = oldText.Substring(ix).Trim();

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

0 comments on commit 152e90b

Please sign in to comment.