Kaydet (Commit) 014c30d1 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Re-add external/harfbuzz/ubsan.patch

...after 5aab2900 "tdf#109142: Update to
HarfBuzz 1.4.8".  The parts that were still relevant for 'make check' are:

* 6694ce6b "external/harfbuzz: Work around ASan
  out of bounds warning"

* 99f7aacd "external/harfbuzz:
  -fsanitize=function"

* ca9a08bb "external/harfbuzz: Silence
  -fsanitize=nonnull-attribute" (plus 83a9c8e0
  "build fix")

Change-Id: Ibff2a7c52c5de60ae00744acd2ef481bbb08706c
üst b6e0fcf8
......@@ -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)
......
--- 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment