[pango] Bug 592484 - invalid write in HB



commit 4c68b4bf575e6d02c658507374c9fb3cb0f958c6
Author: Behdad Esfahbod <behdad behdad org>
Date:   Thu Aug 20 14:01:37 2009 -0400

    Bug 592484 -  invalid write in HB
    
    Fix off-by-one.

 pango/opentype/hb-ot-layout.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc
index 8d0a25a..8882327 100644
--- a/pango/opentype/hb-ot-layout.cc
+++ b/pango/opentype/hb-ot-layout.cc
@@ -226,8 +226,8 @@ _hb_ot_layout_set_glyph_class (hb_face_t                  *face,
     unsigned char *new_klasses;
 
     new_len = len == 0 ? 120 : 2 * len;
-    if (new_len > 65535)
-      new_len = 65535;
+    if (new_len > 65536)
+      new_len = 65536;
     new_klasses = (unsigned char *) realloc (layout->new_gdef.klasses, new_len * sizeof (unsigned char));
 
     if (HB_UNLIKELY (!new_klasses))



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