From 05443e55bc232f0a6a08d5ef6cc58ebf3e373ee7 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Thu, 28 Nov 2019 09:16:58 +0330 Subject: [PATCH] [ot-glyph] Return empty path for empty faces --- src/hb-ot-glyph.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-glyph.cc b/src/hb-ot-glyph.cc index 36686ce2c..38bdf3105 100644 --- a/src/hb-ot-glyph.cc +++ b/src/hb-ot-glyph.cc @@ -150,7 +150,7 @@ hb_ot_glyph_path_create_from_font (hb_font_t *font, hb_codepoint_t glyph) { _hb_ot_glyph_path_vectors *user_data = (_hb_ot_glyph_path_vectors *) malloc (sizeof (_hb_ot_glyph_path_vectors)); - if (unlikely (!user_data || !user_data->init ())) + if (unlikely (!user_data || !user_data->init () || glyph >= font->face->get_num_glyphs ())) { free (user_data); return hb_ot_glyph_path_empty ();