summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-18 00:43:49 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-18 00:43:49 +0200
commit09d1ebb7aed4de4cc63e88d8e89a56c647b0d902 (patch)
tree6554636c35a6a81e7be73b9ef72fcdc8496fc3be /thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh
parent04082597f90dcb624c6466a7e1f173489a8ec517 (diff)
parentec8084d87f273266c5d79d06c421b5167dd97f94 (diff)
Merge pull request #66004 from bruvzg/hb52
Update to version 5.2.0, add new Unicode 15 blocks and scripts.
Diffstat (limited to 'thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh')
-rw-r--r--thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh
index 4b17243d81..13665d7ba1 100644
--- a/thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh
+++ b/thirdparty/harfbuzz/src/OT/Layout/GSUB/SingleSubstFormat1.hh
@@ -42,6 +42,11 @@ struct SingleSubstFormat1_3
hb_codepoint_t d = deltaGlyphID;
hb_codepoint_t mask = get_mask ();
+ /* Help fuzzer avoid this function as much. */
+ unsigned pop = (this+coverage).get_population ();
+ if (pop >= mask)
+ return;
+
hb_set_t intersection;
(this+coverage).intersect_set (c->parent_active_glyphs (), intersection);
@@ -52,7 +57,7 @@ struct SingleSubstFormat1_3
hb_codepoint_t max_before = intersection.get_max ();
hb_codepoint_t min_after = (min_before + d) & mask;
hb_codepoint_t max_after = (max_before + d) & mask;
- if ((this+coverage).get_population () >= max_before - min_before &&
+ if (pop >= max_before - min_before &&
((min_before <= min_after && min_after <= max_before) ||
(min_before <= max_after && max_after <= max_before)))
return;