[subset] fix missing compiled glyph cleanup when serialization succeeds.

This commit is contained in:
Garret Rieger 2023-02-02 22:03:36 +00:00 committed by Behdad Esfahbod
parent 9bd3259335
commit fda200658e
1 changed files with 5 additions and 6 deletions

View File

@ -110,12 +110,11 @@ struct glyf
padded_offsets[i] = glyphs[i].length ();
}
if (!glyf_prime->serialize (c->serializer, glyphs.writer (), use_short_loca, c->plan))
{
if (c->plan->normalized_coords && !c->plan->pinned_at_default)
_free_compiled_subset_glyphs (glyphs, glyphs.length - 1);
return false;
}
bool result = glyf_prime->serialize (c->serializer, glyphs.writer (), use_short_loca, c->plan);
if (c->plan->normalized_coords && !c->plan->pinned_at_default)
_free_compiled_subset_glyphs (glyphs, glyphs.length - 1);
if (!result) return false;
if (unlikely (c->serializer->in_error ())) return_trace (false);