shithub: freetype+ttf2subf

Download patch

ref: 95aeebf438f8249cc7645722cc37dbf408ecfe71
parent: 2ed9d7fc7520e6bee850342be9f8fe6947ea03cb
author: suzuki toshiya <[email protected]>
date: Fri Jul 31 20:30:13 EDT 2009

ftobjs.c: Prevent an overflow in glyph index handling.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-07-31  suzuki toshiya <[email protected]>
 
+	ftobjs.c: Prevent an overflow in glyph index handling.
+
+	* src/base/ftobjs.c (FT_Face_GetCharsOfVariant):
+	Improve the cast in comparison to avoid the truncation.
+
+2009-07-31  suzuki toshiya <[email protected]>
+
 	Improve the variable types in raccess_make_file_name().
 
 	* src/base/ftrfork.c (raccess_make_file_name):
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3297,7 +3297,7 @@
       ((FT_Byte*)buffer)[0] = 0;
 
     if ( face                                     &&
-         glyph_index <= (FT_UInt)face->num_glyphs &&
+         (FT_Long)glyph_index <= face->num_glyphs &&
          FT_HAS_GLYPH_NAMES( face )               )
     {
       FT_Service_GlyphDict  service;