diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index 91854f84e..10de3349a 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -139,8 +139,8 @@ struct TTCHeader inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); if (!SANITIZE (version)) return false; - if (version.major < 1 || version.major > 2) return true; - return table.sanitize (SANITIZE_ARG, CharP(this), CharP(this)); + if (HB_UNLIKELY (version.major < 1 || version.major > 2)) return false; + return HB_LIKELY (table.sanitize (SANITIZE_ARG, CharP(this), CharP(this))); } private: diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh index 4f6c1d9c7..4de5740f0 100644 --- a/src/hb-ot-layout-gdef-private.hh +++ b/src/hb-ot-layout-gdef-private.hh @@ -346,7 +346,7 @@ struct GDEF inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); if (!SANITIZE (version)) return false; - if (version.major != 1) return true; + if (HB_UNLIKELY (version.major != 1)) return false; return SANITIZE_THIS2 (glyphClassDef, attachList) && SANITIZE_THIS2 (ligCaretList, markAttachClassDef) && (version < 0x00010002 || SANITIZE_THIS (markGlyphSetsDef[0])); diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index c5639bbba..2856d34f9 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -937,7 +937,7 @@ struct GSUBGPOS inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); if (!SANITIZE (version)) return false; - if (version.major != 1) return true; + if (HB_UNLIKELY (version.major != 1)) return false; return SANITIZE_THIS3 (scriptList, featureList, lookupList); }