Fix crash in the Kanji timer when the source begins with whitespace and the dest is empty

Originally committed to SVN as r6936.
This commit is contained in:
Thomas Goyne 2012-07-21 03:50:35 +00:00
parent 291a4050d8
commit 556f0514c2

View file

@ -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