From dae99b7769616d354e8cce41fbd7cf780353cb44 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Thu, 25 Mar 2021 12:33:51 -0700 Subject: [PATCH] [subset] don't keep FeatureVariationRecord's with no subsittutions. --- src/hb-ot-layout-common.hh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 60da8087f..45aed92bb 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2965,7 +2965,8 @@ struct ConditionSet + conditions.iter () | hb_apply (subset_offset_array (c, out->conditions, this)) ; - return_trace (true); + + return_trace (bool (out->conditions)); } bool sanitize (hb_sanitize_context_t *c) const @@ -3065,7 +3066,8 @@ struct FeatureTableSubstitution + substitutions.iter () | hb_apply (subset_record_array (l, &(out->substitutions), this)) ; - return_trace (true); + + return_trace (bool (out->substitutions)); } bool sanitize (hb_sanitize_context_t *c) const @@ -3108,10 +3110,9 @@ struct FeatureVariationRecord auto *out = c->subset_context->serializer->embed (this); if (unlikely (!out)) return_trace (false); - out->conditions.serialize_subset (c->subset_context, conditions, base); - out->substitutions.serialize_subset (c->subset_context, substitutions, base, c); - - return_trace (true); + if (!out->conditions.serialize_subset (c->subset_context, conditions, base)) + return_trace (false); + return_trace (out->substitutions.serialize_subset (c->subset_context, substitutions, base, c)); } bool sanitize (hb_sanitize_context_t *c, const void *base) const