diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index 1d6002757..54ffec22f 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -178,6 +178,8 @@ struct RepeatedAddGlyphAction struct ActionSubrecord { + inline unsigned int get_length (void) const { return u.header.actionLength; } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -196,8 +198,6 @@ struct ActionSubrecord } } - inline unsigned int get_length () const { return u.header.actionLength; } - protected: union { ActionSubrecordHeader header; @@ -388,9 +388,10 @@ struct just { TRACE_SANITIZE (this); - return_trace (unlikely (c->check_struct (this) && - horizData.sanitize (c, this, this) && - vertData.sanitize (c, this, this))); + return_trace (likely (c->check_struct (this) && + version.major == 1 && + horizData.sanitize (c, this, this) && + vertData.sanitize (c, this, this))); } protected: diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index c579c1193..68218ecb7 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -147,9 +147,9 @@ struct TrackData inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - sizeTable.sanitize (c, base, nSizes) && - trackTable.sanitize (c, nTracks, base, nSizes)); + return_trace (likely (c->check_struct (this) && + sizeTable.sanitize (c, base, nSizes) && + trackTable.sanitize (c, nTracks, base, nSizes))); } protected: @@ -175,9 +175,9 @@ struct trak { TRACE_SANITIZE (this); - return_trace (unlikely (c->check_struct (this) && - horizData.sanitize (c, this, this) && - vertData.sanitize (c, this, this))); + return_trace (likely (c->check_struct (this) && + horizData.sanitize (c, this, this) && + vertData.sanitize (c, this, this))); } inline bool apply (hb_aat_apply_context_t *c) const