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

pull/2657/head
ebraminio 5 years ago committed by GitHub
parent 05ef75c553
commit 1e48225ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/hb-ot-shape-complex-arabic-fallback.hh
  2. BIN
      test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-shape-fuzzer-5138182937772032

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

Loading…
Cancel
Save