From 556f0514c278383b18f83d155c3e505355f4178f Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 21 Jul 2012 03:50:35 +0000 Subject: [PATCH] Fix crash in the Kanji timer when the source begins with whitespace and the dest is empty Originally committed to SVN as r6936. --- aegisub/src/dialog_kara_timing_copy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/src/dialog_kara_timing_copy.cpp b/aegisub/src/dialog_kara_timing_copy.cpp index 903f8223a..a256d3abe 100644 --- a/aegisub/src/dialog_kara_timing_copy.cpp +++ b/aegisub/src/dialog_kara_timing_copy.cpp @@ -481,7 +481,7 @@ void KaraokeLineMatchDisplay::AutoMatchJapanese() // Eat all whitespace at the start of the destination. if (StringEmptyOrWhitespace(src)) { - while (IsWhitespace(unmatched_destination[destination_sel_length])) + while (destination_sel_length < unmatched_destination.size() && IsWhitespace(unmatched_destination[destination_sel_length])) ++destination_sel_length; // Now we've eaten all spaces in the destination as well // so the selection lengths should be good