提交 d6016e49 编写于 作者: B Behdad Esfahbod

Fix name-table sanitize

上级 ae9877de
...@@ -99,15 +99,15 @@ struct name ...@@ -99,15 +99,15 @@ struct name
inline bool sanitize_records (hb_sanitize_context_t *c) { inline bool sanitize_records (hb_sanitize_context_t *c) {
TRACE_SANITIZE (); TRACE_SANITIZE ();
char *string_pool = (char *) this + stringOffset;
unsigned int _count = count; unsigned int _count = count;
for (unsigned int i = 0; i < _count; i++) for (unsigned int i = 0; i < _count; i++)
if (!nameRecord[i].sanitize (c, this + stringOffset)) return false; if (!nameRecord[i].sanitize (c, string_pool)) return false;
return true; return true;
} }
inline bool sanitize (hb_sanitize_context_t *c) { inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (); TRACE_SANITIZE ();
return true;
return c->check_struct (this) && return c->check_struct (this) &&
likely (format == 0 || format == 1) && likely (format == 0 || format == 1) &&
c->check_array (nameRecord, nameRecord[0].static_size, count) && c->check_array (nameRecord, nameRecord[0].static_size, count) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册