summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-27 01:16:28 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-27 01:16:46 -0400
commit98428c0680625be6737d89bca6104ff95cd7037b (patch)
tree40413230a4e1fce44a8a685f7b4c908393352ec5
parentca180e1f0e2a453bd9ae16791b6bba1328cfffeb (diff)
downloadpango-98428c0680625be6737d89bca6104ff95cd7037b.tar.gz
Fix bug with lookup_index overflowing our static array
Part of Bug 593240 - updating pango to latest git master makes things crash
-rw-r--r--pango/pango-ot-info.c2
1 files changed, 2 insertions, 0 deletions
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,