ref: 0729bc9f5223aeefa6d0bf8573a2ba0634cc1ca6
parent: fecb7a60fae1cc411dcc3728bf84ef12924c0090
author: suzuki toshiya <[email protected]>
date: Thu Sep 10 12:09:55 EDT 2009
[Win64] Improve the computation of random seed from stack address.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-10 suzuki toshiya <[email protected]>
+
+ [Win64] Improve the computation of random seed from stack address.
+
+ On LLP64 platform, the conversion from pointer to FT_Fixed need
+ to drop higher 32-bit. Explict casts are required. Reported by
+ NightStrike from MinGW-w64 project. See
+ http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
+
+ * src/cff/cffgload.c: Convert the pointers to FT_Fixed explicitly.
+
+ * src/psaux/t1decode.c: Ditto.
+
+
2009-09-03 Werner Lemberg <[email protected]>
[raster] Improvements for stand-alone mode.
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -878,9 +878,10 @@
decoder->read_width = 1;
/* compute random seed from stack address of parameter */
- seed = (FT_Fixed)(char*)&seed ^
- (FT_Fixed)(char*)&decoder ^
- (FT_Fixed)(char*)&charstring_base;
+ seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed ^
+ (FT_PtrDist)(char*)&decoder ^
+ (FT_PtrDist)(char*)&charstring_base ) &
+ FT_ULONG_MAX ) ;
seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
if ( seed == 0 )
seed = 0x7384;
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -376,9 +376,10 @@
/* compute random seed from stack address of parameter */
- seed = (FT_Fixed)(char*)&seed ^
- (FT_Fixed)(char*)&decoder ^
- (FT_Fixed)(char*)&charstring_base;
+ seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed ^
+ (FT_PtrDist)(char*)&decoder ^
+ (FT_PtrDist)(char*)&charstring_base ) &
+ FT_ULONG_MAX ) ;
seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
if ( seed == 0 )
seed = 0x7384;