[kerx] Port to hb_sanitize_with_object_t

pull/1412/head
Behdad Esfahbod 6 years ago
parent c405ed0509
commit c5a6b355e1
  1. 19
      src/hb-aat-layout-kerx-table.hh

@ -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);
}

Loading…
Cancel
Save