Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / external / harfbuzz / ubsan.patch
blobb855d5f2140d3dc8f9c08485a3292dcd8b73c779
1 --- src/hb-ot-font.cc
2 +++ src/hb-ot-font.cc
3 @@ -138,7 +138,7 @@
4 return this->default_advance;
7 - return this->table->longMetric[MIN (glyph, (uint32_t) this->num_advances - 1)].advance
8 + return static_cast<OT::LongMetric const *>(this->table->longMetric)[MIN (glyph, (uint32_t) this->num_advances - 1)].advance
9 + this->var->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
12 @@ -458,8 +458,9 @@
15 static void
16 -_hb_ot_font_destroy (hb_ot_font_t *ot_font)
17 +_hb_ot_font_destroy (void *ot_font_)
19 + hb_ot_font_t *ot_font = static_cast<hb_ot_font_t *>(ot_font_);
20 ot_font->cmap.fini ();
21 ot_font->h_metrics.fini ();
22 ot_font->v_metrics.fini ();
23 --- src/hb-private.hh
24 +++ src/hb-private.hh
25 @@ -461,6 +461,7 @@
26 template <typename T>
27 inline const Type *bsearch (T *key) const
29 + if (len == 0) return NULL;
30 return (const Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp);