[mort] Fix version check in sanitize

This commit is contained in:
Behdad Esfahbod 2018-10-30 19:33:31 -07:00
parent c2527a1bc2
commit 2d9467340b
1 changed files with 2 additions and 3 deletions

View File

@ -1052,8 +1052,7 @@ struct mortmorx
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
if (!version.sanitize (c) || version < 2 ||
!chainCount.sanitize (c))
if (!version.sanitize (c) || !version || !chainCount.sanitize (c))
return_trace (false);
const Chain<Types> *chain = &firstChain;
@ -1070,7 +1069,7 @@ struct mortmorx
protected:
HBUINT16 version; /* Version number of the glyph metamorphosis table.
* 2 or 3. */
* 1, 2, or 3. */
HBUINT16 unused; /* Set to 0. */
HBUINT32 chainCount; /* Number of metamorphosis chains contained in this
* table. */