[subset] when subsetting preprocessor fails, reference the returned face.

The caller of the method is expected to destroy the returned result.
This commit is contained in:
Garret Rieger 2022-12-21 21:18:20 +00:00 committed by Behdad Esfahbod
parent fc8fa18418
commit d77fca997e
1 changed files with 2 additions and 2 deletions

View File

@ -480,7 +480,7 @@ hb_subset_preprocess (hb_face_t *source)
{
hb_subset_input_t* input = hb_subset_input_create_or_fail ();
if (!input)
return source;
return hb_face_reference (source);
hb_set_clear (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
hb_set_invert (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
@ -525,7 +525,7 @@ hb_subset_preprocess (hb_face_t *source)
if (!new_source) {
DEBUG_MSG (SUBSET, nullptr, "Preprocessing failed due to subset failure.");
return source;
return hb_face_reference (source);
}
return new_source;