[font] Protect against div-by-zero

This commit is contained in:
Behdad Esfahbod 2022-11-23 16:45:46 -07:00
parent 060ecac949
commit 5f3a780614
1 changed files with 4 additions and 3 deletions

View File

@ -628,9 +628,10 @@ hb_font_get_glyph_shape_default (hb_font_t *font,
hb_font_get_glyph_shape_default_adaptor_t adaptor = { hb_font_get_glyph_shape_default_adaptor_t adaptor = {
draw_funcs, draw_funcs,
draw_data, draw_data,
(float) font->x_scale / (float) font->parent->x_scale, font->parent->x_scale ? (float) font->x_scale / (float) font->parent->x_scale : 0.f,
(float) font->y_scale / (float) font->parent->y_scale, font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0.f,
(font->slant - font->parent->slant) * (float) font->x_scale / (float) font->parent->y_scale font->parent->y_scale ? (font->slant - font->parent->slant) *
(float) font->x_scale / (float) font->parent->y_scale : 0.f
}; };
font->parent->get_glyph_shape (glyph, font->parent->get_glyph_shape (glyph,