shithub: freetype+ttf2subf

Download patch

ref: 3bda1f9949d20cc46fc76e3876bcff545cc8d665
parent: 8eb551f1b3feaad1b0e389caba118a87f8d00f8b
author: suzuki toshiya <[email protected]>
date: Fri Jul 31 20:37:56 EDT 2009

pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-07-31  suzuki toshiya <[email protected]>
 
+	pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops.
+
+	* src/pcf/pcfread.c (pcf_get_properties): Load `nprops'
+	as FT_ULong value from PCF file, but truncate it as
+	int to fit PCF_Face->nprops.  The number of truncated
+	properties is shown in the trace message.
+
+2009-07-31  suzuki toshiya <[email protected]>
+
 	gxvalid: Extend a few local variables to reduce the casts.
 
 	* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -399,7 +399,7 @@
   {
     PCF_ParseProperty  props      = 0;
     PCF_Property       properties;
-    FT_UInt            nprops, i;
+    FT_ULong           nprops, i;
     FT_ULong           format, size;
     FT_Error           error;
     FT_Memory          memory     = FT_FACE(face)->memory;
@@ -433,8 +433,11 @@
     if ( error )
       goto Bail;
 
-    FT_TRACE4(( "  nprop = %d\n", nprops ));
+    FT_TRACE4(( "  nprop = %d (truncate %d props)\n",
+                (int)nprops, nprops - (int)nprops ));
 
+    nprops = nprops - (int)nprops;
+
     /* rough estimate */
     if ( nprops > size / PCF_PROPERTY_SIZE )
     {
@@ -442,7 +445,7 @@
       goto Bail;
     }
 
-    face->nprops = nprops;
+    face->nprops = (int)nprops;
 
     if ( FT_NEW_ARRAY( props, nprops ) )
       goto Bail;