summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--external/harfbuzz/UnpackedTarball_harfbuzz.mk1
-rw-r--r--external/harfbuzz/ubsan.patch18
2 files changed, 10 insertions, 9 deletions
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 8ec1c8d3ab23..74c990c0c1aa 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
external/harfbuzz/clang-cl.patch \
+ external/harfbuzz/ubsan.patch \
))
ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE)
diff --git a/external/harfbuzz/ubsan.patch b/external/harfbuzz/ubsan.patch
index c5f923448c8e..c2247ef84d3e 100644
--- a/external/harfbuzz/ubsan.patch
+++ b/external/harfbuzz/ubsan.patch
@@ -1,11 +1,11 @@
---- src/hb-ot-font.cc
-+++ src/hb-ot-font.cc
-@@ -138,7 +138,7 @@
- return this->default_advance;
+--- src/hb-ot-hmtx-table.hh
++++ src/hb-ot-hmtx-table.hh
+@@ -143,7 +143,7 @@
+ return default_advance;
+ }
+
+- return table->longMetric[MIN (glyph, (uint32_t) num_advances - 1)].advance
++ return static_cast<OT::LongMetric const *>(table->longMetric)[MIN (glyph, (uint32_t) num_advances - 1)].advance
+ + var_table->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
}
-- return this->table->longMetric[MIN (glyph, (uint32_t) this->num_advances - 1)].advance
-+ return static_cast<OT::LongMetric const *>(this->table->longMetric)[MIN (glyph, (uint32_t) this->num_advances - 1)].advance
- + this->var->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
- }
- };