From 02cfe421c898f4e62da38ed70a53a36d25f99bb8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 4 Aug 2026 19:09:55 -0600 Subject: [PATCH] [subset] Use strict comparisons in avar2 region culling The support scalar is 1 (not 0) at v == peak, so a tent whose peak sits exactly on the reachable-range boundary is live there. The ranges' one-unit padding at their producer already prevented wrong culling in practice; strictness makes the predicate correct on its own terms. Co-Authored-By: Claude Fable 5 --- src/hb-ot-layout-common.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 2e5416bfe..0927f7047 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2830,7 +2830,12 @@ _hb_avar2_region_is_dead (const hb_hashmap_t &axis_tuples, if (start < 0 && end > 0) continue; int lo = (int) roundf ((float) range->minimum * 16384.f); int hi = (int) roundf ((float) range->maximum * 16384.f); - if (hi <= start || lo >= end) + /* Strict comparisons: the scalar is 1 (not 0) at v == peak, so a tent + * whose peak sits exactly on the range boundary is still live there. + * (Reachable ranges are padded by one F2Dot14 unit at their producer, + * which already covers this; strictness keeps the predicate correct on + * its own terms.) */ + if (hi < start || lo > end) return true; } return false;