From 3c364321adbdbc8a913f2ed1502babfe8044f434 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Tue, 12 May 2026 19:14:54 -0400 Subject: [PATCH] [smooth, raster] Fix signedness warning. * src/smooth/ftgrays.c (gray_convert_glyph): Use unsigned estimate. * src/raster/ftraster.c (ft_black_render): Ditto and expand. --- src/raster/ftraster.c | 7 ++++--- src/smooth/ftgrays.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) 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;