diff options
Diffstat (limited to 'external/harfbuzz/ubsan.patch')
-rw-r--r-- | external/harfbuzz/ubsan.patch | 32 |
1 files changed, 32 insertions, 0 deletions
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); + } + |