[pango] Fix bug with lookup_index overflowing our static array



commit 98428c0680625be6737d89bca6104ff95cd7037b
Author: Behdad Esfahbod <behdad behdad org>
Date:   Thu Aug 27 01:16:28 2009 -0400

    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 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index 4e7571d..f4f4cee 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]