From 98428c0680625be6737d89bca6104ff95cd7037b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Aug 2009 01:16:28 -0400 Subject: Fix bug with lookup_index overflowing our static array Part of Bug 593240 - updating pango to latest git master makes things crash --- pango/pango-ot-info.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index 4e7571d1..f4f4cee0 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -554,6 +554,7 @@ _pango_ot_info_substitute (const PangoOTInfo *info, &lookup_count, lookup_indexes); + lookup_count = MIN (G_N_ELEMENTS (lookup_indexes), lookup_count); for (j = 0; j < lookup_count; j++) hb_ot_layout_substitute_lookup (info->hb_face, buffer->buffer, @@ -601,6 +602,7 @@ _pango_ot_info_position (const PangoOTInfo *info, &lookup_count, lookup_indexes); + lookup_count = MIN (G_N_ELEMENTS (lookup_indexes), lookup_count); for (j = 0; j < lookup_count; j++) hb_ot_layout_position_lookup (info->hb_face, hb_font, buffer->buffer, -- cgit v1.2.1