--- 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(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(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 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); }