office-gobmx/external/harfbuzz/ubsan.patch
Stephan Bergmann 0ea5c91253 Resurrect still relevant part of external/harfbuzz/ubsan.patch
...after 945c10f42f "upload harfbuzz 1.6.3" had
dropped it completely.  Still necessary to e.g. avoid "runtime error: index 3
out of bounds for type 'OT::LongMetric const[1]'" during CppunitTest_emfio_wmf.

Change-Id: Idd93f6224f7e43016a71678bcaf5cc0527f95cee
2017-11-13 19:03:18 +01:00

11 lines
427 B
Diff

--- 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?!
}
};