summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:42 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:42 +0900
commit12f2ee55a1f70a3528edf5dcaf0c8a40ed63dacf (patch)
treed775b558c2554e613d79b33b9d1e547ed812eb6e
parent2dacccc174576cc9a2fc5b03c7ae4a21487ebe7f (diff)
downloadfreetype2-12f2ee55a1f70a3528edf5dcaf0c8a40ed63dacf.tar.gz
pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops.
-rw-r--r--ChangeLog9
-rw-r--r--src/pcf/pcfread.c9
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fd5c13cf..a50ca2771 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ 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-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
gxvalid: Extend a few local variables to reduce the casts.
* src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index cdef433bc..a60505bf2 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -399,7 +399,7 @@ THE SOFTWARE.
{
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,7 +433,10 @@ THE SOFTWARE.
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 @@ THE SOFTWARE.
goto Bail;
}
- face->nprops = nprops;
+ face->nprops = (int)nprops;
if ( FT_NEW_ARRAY( props, nprops ) )
goto Bail;