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

[kerx] Port to hb_sanitize_with_object_t

上级 c405ed05
......@@ -926,13 +926,11 @@ struct KerxTable
if (reverse)
c->buffer->reverse ();
/* See comment in sanitize() for conditional here. */
if (i < count - 1)
c->sanitizer.set_object (st);
else
c->sanitizer.set_object ();
ret |= st->dispatch (c);
{
/* See comment in sanitize() for conditional here. */
hb_sanitize_with_object_t with (&c->sanitizer, i < count - 1 ? st : (const SubTable *) nullptr);
ret |= st->dispatch (c);
}
if (reverse)
c->buffer->reverse ();
......@@ -943,7 +941,6 @@ struct KerxTable
st = &StructAfter<SubTable> (*st);
c->set_lookup_index (c->lookup_index + 1);
}
c->sanitizer.set_object ();
return ret;
}
......@@ -962,7 +959,6 @@ struct KerxTable
unsigned int count = thiz()->tableCount;
for (unsigned int i = 0; i < count; i++)
{
c->set_object ();
if (unlikely (!st->u.header.sanitize (c)))
return_trace (false);
/* OpenType kern table has 2-byte subtable lengths. That's limiting.
......@@ -972,14 +968,13 @@ struct KerxTable
* is simply ignored. Which makes sense. It's only needed if you
* have multiple subtables. To handle such fonts, we just ignore
* the length for the last subtable. */
if (i < count - 1)
c->set_object (st);
hb_sanitize_with_object_t with (c, i < count - 1 ? st : (const SubTable *) nullptr);
if (unlikely (!st->sanitize (c)))
return_trace (false);
st = &StructAfter<SubTable> (*st);
}
c->set_object ();
return_trace (true);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册