From 70b06cc6e71e15f0d7550f67b113eed5e6f30a5f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 10 Feb 2018 16:13:06 -0600 Subject: [PATCH] More fixes --- util/hb-subset.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/hb-subset.cc b/util/hb-subset.cc index 22349ff13..a3505a814 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -37,7 +37,7 @@ struct subset_consumer_t { subset_consumer_t (option_parser_t *parser) - : failed (false), options(parser) {} + : failed (false), options (parser), font (nullptr), codepoints (nullptr) {} void init (hb_buffer_t *buffer_, const font_options_t *font_opts) @@ -74,6 +74,8 @@ struct subset_consumer_t } int bytes_written = fwrite(data, 1, data_length, fp_out); + fclose (fp_out); + if (bytes_written == -1) { fprintf(stderr, "Unable to write output file\n"); return false; @@ -93,8 +95,6 @@ struct subset_consumer_t hb_subset_input_t *subset_input = hb_subset_input_create (codepoints); hb_face_t *face = hb_font_get_face (font); - - hb_face_t *new_face = hb_subset(face, subset_profile, subset_input); hb_blob_t *result = hb_face_reference_blob (new_face);