提交 b8208bc1 编写于 作者: B Behdad Esfahbod 提交者: Raph Levien

Don't get stuck on invalid UTF-16

Replaces invalid unicode with replacement character U+FFFD and always
makes forward progress.

Bug: 15849380

Change-Id: Ic59ef6c64b0f5c4450bcae61597adcc269d6e7c5
上级 f0a1e5b2
......@@ -397,11 +397,10 @@ static hb_codepoint_t decodeUtf16(const uint16_t* chars, size_t len, ssize_t* it
const hb_codepoint_t delta = (0xd800 << 10) + 0xdc00 - 0x10000;
return (((hb_codepoint_t)v) << 10) + v2 - delta;
}
(*iter) -= 2;
return ~0u;
(*iter) -= 1;
return 0xFFFDu;
} else {
(*iter)--;
return ~0u;
return 0xFFFDu;
}
} else {
return v;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册