From 82f6b6f388b801a1483854cb56a2cadbb94e0f2b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 6 Sep 2012 01:12:50 -0400 Subject: [PATCH] Minor --- src/hb-ot-shape-complex-arabic-fallback.hh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index c9e89a61d..17f984440 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -112,9 +112,9 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan, unsigned int num_first_glyphs = 0; /* We know that all our ligatures are 2-component */ - OT::GlyphID ligatures_list[ARRAY_LENGTH_CONST (first_glyphs) * ARRAY_LENGTH_CONST(ligature_table[0].ligatures)]; - unsigned int component_count_list[ARRAY_LENGTH_CONST (ligatures_list)]; - OT::GlyphID component_list[ARRAY_LENGTH_CONST (ligatures_list) * 1/* One extra component per ligature */]; + OT::GlyphID ligature_list[ARRAY_LENGTH_CONST (first_glyphs) * ARRAY_LENGTH_CONST(ligature_table[0].ligatures)]; + unsigned int component_count_list[ARRAY_LENGTH_CONST (ligature_list)]; + OT::GlyphID component_list[ARRAY_LENGTH_CONST (ligature_list) * 1/* One extra component per ligature */]; unsigned int num_ligatures = 0; /* Populate arrays */ @@ -150,7 +150,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan, ligature_per_first_glyph_count_list[i]++; - ligatures_list[num_ligatures].set (ligature_glyph); + ligature_list[num_ligatures].set (ligature_glyph); component_count_list[num_ligatures] = 2; component_list[num_ligatures].set (second_glyph); num_ligatures++; @@ -159,11 +159,12 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan, OT::Supplier first_glyphs_supplier (first_glyphs, num_first_glyphs); OT::Supplier ligature_per_first_glyph_count_supplier (ligature_per_first_glyph_count_list, num_first_glyphs); - OT::Supplier ligatures_supplier (ligatures_list, num_ligatures); + OT::Supplier ligatures_supplier (ligature_list, num_ligatures); OT::Supplier component_count_supplier (component_count_list, num_ligatures); OT::Supplier component_supplier (component_list, num_ligatures); - char buf[2048]; + /* 16 bytes per ligature ought to be enough... */ + char buf[ARRAY_LENGTH_CONST (ligature_list) * 16 + 128]; OT::hb_serialize_context_t c (buf, sizeof (buf)); OT::SubstLookup *lookup = c.start_serialize (); bool ret = lookup->serialize_ligature (&c,