summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
index f10ef54dbdc..7cea9f18374 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
@@ -594,14 +594,20 @@ static void _attach_accelerator_data (hb_subset_plan_t* plan,
* @input: input to use for the subsetting.
*
* Subsets a font according to provided input. Returns nullptr
- * if the subset operation fails.
+ * if the subset operation fails or the face has no glyphs.
*
* Since: 2.9.0
**/
hb_face_t *
hb_subset_or_fail (hb_face_t *source, const hb_subset_input_t *input)
{
- if (unlikely (!input || !source)) return hb_face_get_empty ();
+ if (unlikely (!input || !source)) return nullptr;
+
+ if (unlikely (!source->get_num_glyphs ()))
+ {
+ DEBUG_MSG (SUBSET, nullptr, "No glyphs in source font.");
+ return nullptr;
+ }
hb_subset_plan_t *plan = hb_subset_plan_create_or_fail (source, input);
if (unlikely (!plan)) {