[ENOMEM] Check whether serialize context isn't in error

This commit is contained in:
ebraminio 2020-08-13 23:22:14 +04:30 committed by GitHub
parent 05ef75c553
commit 1e48225ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS
hb_array (substitutes, num_glyphs)); hb_array (substitutes, num_glyphs));
c.end_serialize (); c.end_serialize ();
return ret ? c.copy<OT::SubstLookup> () : nullptr; return ret && !c.in_error () ? c.copy<OT::SubstLookup> () : nullptr;
} }
static OT::SubstLookup * static OT::SubstLookup *
@ -170,7 +170,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
c.end_serialize (); c.end_serialize ();
/* TODO sanitize the results? */ /* TODO sanitize the results? */
return ret ? c.copy<OT::SubstLookup> () : nullptr; return ret && !c.in_error () ? c.copy<OT::SubstLookup> () : nullptr;
} }
static OT::SubstLookup * static OT::SubstLookup *