diff --git a/util/hb-subset.cc b/util/hb-subset.cc index 22349ff138d3d4eec9e7b33d5640f185781542e5..a3505a8143d3f00f9511b50263031ff7a0d13870 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);