[Libreoffice-commits] core.git: external/harfbuzz

Stephan Bergmann sbergman at redhat.com
Mon Nov 13 18:05:56 UTC 2017


 external/harfbuzz/UnpackedTarball_harfbuzz.mk |    1 +
 external/harfbuzz/ubsan.patch                 |   11 +++++++++++
 2 files changed, 12 insertions(+)

New commits:
commit 0ea5c91253926181488a1da61a31d49d50ed09d1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 13 19:03:18 2017 +0100

    Resurrect still relevant part of external/harfbuzz/ubsan.patch
    
    ...after 945c10f42fe6d22031e7424b47481ac2cfb539be "upload harfbuzz 1.6.3" had
    dropped it completely.  Still necessary to e.g. avoid "runtime error: index 3
    out of bounds for type 'OT::LongMetric const[1]'" during CppunitTest_emfio_wmf.
    
    Change-Id: Idd93f6224f7e43016a71678bcaf5cc0527f95cee

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
new file mode 100644
index 000000000000..c5f923448c8e
--- /dev/null
+++ b/external/harfbuzz/ubsan.patch
@@ -0,0 +1,11 @@
+--- src/hb-ot-font.cc
++++ src/hb-ot-font.cc
+@@ -138,7 +138,7 @@
+ 	return this->default_advance;
+     }
+ 
+-    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?!
+   }
+ };


More information about the Libreoffice-commits mailing list