Add missing test for off the end

git-svn-id: https://cld2.googlecode.com/svn/trunk@74 b252ecd4-b096-bf77-eb8e-91563289f87e
This commit is contained in:
dsites@google.com
2013-08-25 17:14:42 +00:00
parent 956e8de541
commit 622f0da9cb

View File

@@ -1010,7 +1010,8 @@ bool ScriptScanner::GetOneScriptSpan(LangSpan* span) {
}
// Almost done. Back up to a character boundary if needed
while ((0 < take) && ((next_byte_[take] & 0xc0) == 0x80)) {
while ((0 < take) && (take < byte_length_) &&
((next_byte_[take] & 0xc0) == 0x80)) {
// Back up over continuation byte
--take;
--put;