Fail sanitize on major version mismatch
We handle major-version differences via get_for_data(), so sanitize should never see a major version mismatch.
This commit is contained in:
parent
df3f505dcf
commit
1856184b93
|
@ -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:
|
||||
|
|
|
@ -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]));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue