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:
@@ -1010,7 +1010,8 @@ bool ScriptScanner::GetOneScriptSpan(LangSpan* span) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Almost done. Back up to a character boundary if needed
|
// 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
|
// Back up over continuation byte
|
||||||
--take;
|
--take;
|
||||||
--put;
|
--put;
|
||||||
|
Reference in New Issue
Block a user