diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index 178aefeca..08b4c9dd7 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -2661,8 +2661,8 @@ const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; - FT_Long estimate; - int ret; + FT_ULong estimate; + int ret; #ifndef FT_STATIC_RASTER black_TWorker worker[1]; @@ -2712,7 +2712,8 @@ ras.bOrigin += ras.bTop * ras.bPitch; /* allocate memory based on empirical estimate from CJK fonts */ - estimate = ( ras.bTop + ras.bRight ) * 8L + 768L; + estimate = ( ras.bTop + ras.bRight ) * 8UL + + 80UL * sizeof ( TProfile ) / sizeof ( Long ); if ( estimate > FT_MAX_BLACK_POOL ) { FT_Error error; diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index ccacab8cb..0f1cf4418 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -1952,8 +1952,8 @@ typedef ptrdiff_t FT_PtrDist; gray_raster_render( FT_Raster raster, const FT_Raster_Params* params ) { - FT_Long estimate; - int ret; + FT_ULong estimate; + int ret; const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; @@ -2032,7 +2032,7 @@ typedef ptrdiff_t FT_PtrDist; /* allocate memory based on empirical estimate from CJK fonts */ estimate = ( ras.cbox.xMax - ras.cbox.xMin + - ras.cbox.yMax - ras.cbox.yMin ) * 10; + ras.cbox.yMax - ras.cbox.yMin ) * 10UL; if ( estimate > FT_MAX_GRAY_POOL ) { FT_Error error;