Commit eec405540d3148bd581c3cdf7e7f126581739ccd

suzuki toshiya 2009-08-01T00:32:24

pcf: Fix a comparison between FT_Long and FT_ULong.

diff --git a/ChangeLog b/ChangeLog
index d020957..0bbb95b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
 
+	pcf: Fix a comparison between FT_Long and FT_ULong.
+
+	* src/pcf/pcfread.c (pcf_get_bitmaps): Return an error
+	if PCF_Face->nemetrics is negative.
+
+2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
 	gxvalid: Guarantee `nFeatureFlags' size up to 32-bit.
 
 	* src/gxvalid/gxvmort.c (gxv_mort_featurearray_validate):
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 9cce3f5..cdef433 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -692,7 +692,8 @@ THE SOFTWARE.
 
     FT_TRACE4(( "  number of bitmaps: %d\n", nbitmaps ));
 
-    if ( nbitmaps != face->nmetrics )
+    /* XXX: PCF_Face->nmetrics is singed FT_Long, see pcf.h */
+    if ( face->nmetrics < 0 || nbitmaps != ( FT_ULong )face->nmetrics )
       return PCF_Err_Invalid_File_Format;
 
     if ( FT_NEW_ARRAY( offsets, nbitmaps ) )