From dc03a993d0f2b6db7c5cfb11eaa6e8a4f6f274e6 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sun, 12 Jan 2020 14:21:29 +0330 Subject: [PATCH] Fix collect lookups logic of FeatureTableSubstitution (#2097) https://crbug.com/oss-fuzz/20036 --- src/hb-ot-layout-common.hh | 6 +++--- ...e-minimized-hb-subset-fuzzer-5715299773186048 | Bin 0 -> 6717 bytes 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5715299773186048 diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index af394b5b7..fec8f1ec5 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2299,9 +2299,9 @@ struct FeatureTableSubstitutionRecord { friend struct FeatureTableSubstitution; - void collect_lookups (hb_set_t *lookup_indexes /* OUT */) const + void collect_lookups (const void *base, hb_set_t *lookup_indexes /* OUT */) const { - return (this+feature).add_lookup_indexes_to (lookup_indexes); + return (base+feature).add_lookup_indexes_to (lookup_indexes); } bool sanitize (hb_sanitize_context_t *c, const void *base) const @@ -2338,7 +2338,7 @@ struct FeatureTableSubstitution | hb_filter (feature_indexes, &FeatureTableSubstitutionRecord::featureIndex) | hb_apply ([=] (const FeatureTableSubstitutionRecord& r) { - r.collect_lookups (lookup_indexes); + r.collect_lookups (this, lookup_indexes); }) ; } diff --git a/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5715299773186048 b/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5715299773186048 new file mode 100644 index 0000000000000000000000000000000000000000..b7a37214a8c1ab2a0d17898d71f1002c15170165 GIT binary patch literal 6717 zcmeGgO;1xnaJHqTE#*;2NTZ28`2!Tc5>J4ocp$+Ph$fI2gC0z@HGs6BX(XlCvTZ1& z&jJmp2a_fy9>k*_xcLK&a*@P%Fx)tJs7ViXX1A}_k46p{`{3wA& zp+Zx^i*yDUa!mLK=n!}ZVytWvcsLAW+dE~dyh(sDhN9(xoK@ ze_%k{7*{xJKWI~mPia7|ak(cX-iYhHR~s&Qk4E-B2kWmjt@pD*G+FW1$E?=Gm&Tq| zBc@QC`&SWOi{qcmV&vO>WSSrRjpw2DCk@k5#m33kGym~%QZXU`fDO)q{ omh^Sg_v<;}ke+&vv=7r_o8iOi`7q;tT!;7L)x1skuw7u^0T9tYBLDyZ literal 0 HcmV?d00001