From c405ed0509afaa7c3846e8e461bedfbceb0cd937 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 Nov 2018 23:46:15 -0500 Subject: [PATCH] [morx] Port to hb_sanitize_with_object_t --- src/hb-aat-layout-morx-table.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index bc7c3c37b..15332d0f6 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -911,6 +911,13 @@ struct ChainSubtable } } + inline bool apply (hb_aat_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_sanitize_with_object_t with (&c->sanitizer, this); + return_trace (dispatch (c)); + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -919,6 +926,7 @@ struct ChainSubtable !c->check_range (this, length)) return_trace (false); + hb_sanitize_with_object_t with (c, this); return_trace (dispatch (c)); } @@ -1026,9 +1034,7 @@ struct Chain if (reverse) c->buffer->reverse (); - c->sanitizer.set_object (subtable); - - subtable->dispatch (c); + subtable->apply (c); if (reverse) c->buffer->reverse (); @@ -1041,7 +1047,6 @@ struct Chain subtable = &StructAfter > (*subtable); c->set_lookup_index (c->lookup_index + 1); } - c->sanitizer.set_object (); } inline unsigned int get_size (void) const { return length; } @@ -1061,15 +1066,10 @@ struct Chain unsigned int count = subtableCount; for (unsigned int i = 0; i < count; i++) { - c->set_object (); - if (unlikely (!c->check_struct (subtable))) - return_trace (false); - c->set_object (subtable); if (!subtable->sanitize (c)) return_trace (false); subtable = &StructAfter > (*subtable); } - c->set_object (); return_trace (true); }