[aat] Change version field

pull/1164/head
Behdad Esfahbod 6 years ago
parent 29c2bd1795
commit 2f97da6e2d
  1. 14
      src/hb-aat-layout-morx-table.hh

@ -831,7 +831,7 @@ struct Chain
inline unsigned int get_size (void) const { return length; } inline unsigned int get_size (void) const { return length; }
inline bool sanitize (hb_sanitize_context_t *c, unsigned int major) const inline bool sanitize (hb_sanitize_context_t *c, unsigned int version) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
if (!length.sanitize (c) || if (!length.sanitize (c) ||
@ -862,7 +862,7 @@ struct Chain
UnsizedArrayOf<Feature> featureZ; /* Features. */ UnsizedArrayOf<Feature> featureZ; /* Features. */
/*ChainSubtable firstSubtable;*//* Subtables. */ /*ChainSubtable firstSubtable;*//* Subtables. */
/*subtableGlyphCoverageArray*/ /* Only if major == 3. */ /*subtableGlyphCoverageArray*/ /* Only if version >= 3. We don't use. */
public: public:
DEFINE_SIZE_MIN (16); DEFINE_SIZE_MIN (16);
@ -892,8 +892,7 @@ struct morx
inline bool sanitize (hb_sanitize_context_t *c) const inline bool sanitize (hb_sanitize_context_t *c) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
if (!version.sanitize (c) || if (!version.sanitize (c) || version < 2 ||
(version.major >> (sizeof (HBUINT32) == 4 ? 1 : 0)) != 1 ||
!chainCount.sanitize (c)) !chainCount.sanitize (c))
return_trace (false); return_trace (false);
@ -901,7 +900,7 @@ struct morx
unsigned int count = chainCount; unsigned int count = chainCount;
for (unsigned int i = 0; i < count; i++) for (unsigned int i = 0; i < count; i++)
{ {
if (!chain->sanitize (c, version.major)) if (!chain->sanitize (c, version))
return_trace (false); return_trace (false);
chain = &StructAfter<Chain> (*chain); chain = &StructAfter<Chain> (*chain);
} }
@ -910,8 +909,9 @@ struct morx
} }
protected: protected:
FixedVersion<>version; /* Version number of the glyph metamorphosis table. HBUINT16 version; /* Version number of the glyph metamorphosis table.
* 1 for mort, 2 or 3 for morx. */ * 2 or 3. */
HBUINT16 unused; /* Set to 0. */
HBUINT32 chainCount; /* Number of metamorphosis chains contained in this HBUINT32 chainCount; /* Number of metamorphosis chains contained in this
* table. */ * table. */
Chain firstChain; /* Chains. */ Chain firstChain; /* Chains. */

Loading…
Cancel
Save