[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - external/harfbuzz

Stephan Bergmann sbergman at redhat.com
Thu Aug 17 09:05:54 UTC 2017


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

New commits:
commit 1d5f35218ef2176af445a0644bd329763b77feb4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Aug 16 08:52:26 2017 +0200

    Re-add external/harfbuzz/ubsan.patch
    
    ...after 5aab2900dfdc9f12adda378470149670a2a069df "tdf#109142: Update to
    HarfBuzz 1.4.8".  The parts that were still relevant for 'make check' are:
    
    * 6694ce6b542367074667e4445a6b7f50568a2729 "external/harfbuzz: Work around ASan
      out of bounds warning"
    
    * 99f7aacd5b39a0f79351d8d7568b2e43d39878cb "external/harfbuzz:
      -fsanitize=function"
    
    * ca9a08bbf7d42727a93b5f725784308a3590c0fe "external/harfbuzz: Silence
      -fsanitize=nonnull-attribute" (plus 83a9c8e046dfcaccdb1114ec5a386a11fcca3a02
      "build fix")
    
    Change-Id: Ibff2a7c52c5de60ae00744acd2ef481bbb08706c
    (cherry picked from commit 014c30d12945f3c48e3b4758a01fa0721d1ec3c3)
    Reviewed-on: https://gerrit.libreoffice.org/41232
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 01a889140df5..187789e6fb3f 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -15,6 +15,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..b855d5f2140d
--- /dev/null
+++ b/external/harfbuzz/ubsan.patch
@@ -0,0 +1,32 @@
+--- 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?!
+   }
+ };
+@@ -458,8 +458,9 @@
+ }
+ 
+ static void
+-_hb_ot_font_destroy (hb_ot_font_t *ot_font)
++_hb_ot_font_destroy (void *ot_font_)
+ {
++  hb_ot_font_t *ot_font = static_cast<hb_ot_font_t *>(ot_font_);
+   ot_font->cmap.fini ();
+   ot_font->h_metrics.fini ();
+   ot_font->v_metrics.fini ();
+--- src/hb-private.hh
++++ src/hb-private.hh
+@@ -461,6 +461,7 @@
+   template <typename T>
+   inline const Type *bsearch (T *key) const
+   {
++    if (len == 0) return NULL;
+     return (const Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);
+   }
+ 


More information about the Libreoffice-commits mailing list