From 5021ba2a2186a77d7d70be5602b960d14634d8b2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 8 Feb 2018 15:11:28 -0600 Subject: [PATCH] [aat] Minor --- src/hb-aat-layout-common-private.hh | 10 +++++----- src/hb-aat-layout-morx-table.hh | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/hb-aat-layout-common-private.hh b/src/hb-aat-layout-common-private.hh index e0f59a4a..fea3b094 100644 --- a/src/hb-aat-layout-common-private.hh +++ b/src/hb-aat-layout-common-private.hh @@ -563,9 +563,9 @@ struct StateTable unsigned int entry = 0; while (state < num_states) { - if (unlikely (!c->check_array (states + state * nClasses, - states[0].static_size, - nClasses * (num_states - state)))) + if (unlikely (!c->check_array (states, + states[0].static_size * nClasses, + num_states))) return_trace (false); { /* Sweep new states. */ const HBUINT16 *stop = &states[num_states * nClasses]; @@ -574,9 +574,9 @@ struct StateTable state = num_states; } - if (unlikely (!c->check_array (entries + entry, + if (unlikely (!c->check_array (entries, entries[0].static_size, - num_entries - entry))) + num_entries))) return_trace (false); { /* Sweep new entries. */ const Entry *stop = &entries[num_entries]; diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index f8209a60..fc834ebf 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -281,7 +281,7 @@ struct ContextualSubtable TRACE_SANITIZE (this); unsigned int num_entries = 0; - if (unlikely (!machine.sanitize (c, &num_entries))) return false; + if (unlikely (!machine.sanitize (c, &num_entries))) return_trace (false); unsigned int num_lookups = 0; @@ -454,9 +454,8 @@ struct LigatureSubtable { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ - return c->check_struct (this) && machine.sanitize (c) && - ligAction && component && ligature; - return_trace (true); + return_trace (c->check_struct (this) && machine.sanitize (c) && + ligAction && component && ligature); } protected: -- GitLab