From c7fd93565c2f9f967aa24fe8dee028c2600c459d Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Thu, 30 Oct 2014 22:43:01 -0400 Subject: [PATCH] [smooth] Fix Savannah bug #35604 (cont'd). * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and casts that became unnecessary after the variable type upgrades. --- ChangeLog | 7 +++++++ src/smooth/ftsmooth.c | 35 ++++++----------------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a09f59ef..87ae1a504 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-10-30 Alexei Podtelezhnikov + + [smooth] Fix Savannah bug #35604 (cont'd). + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and + casts that became unnecessary after the variable type upgrades. + 2014-10-29 Alexei Podtelezhnikov [smooth] Improve code readability. diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index fce42cfeb..7323042cc 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -155,27 +155,8 @@ cbox.xMax = FT_PIX_CEIL( cbox.xMax ); cbox.yMax = FT_PIX_CEIL( cbox.yMax ); - if ( cbox.xMin < 0 && cbox.xMax > FT_INT_MAX + cbox.xMin ) - { - FT_ERROR(( "ft_smooth_render_generic: glyph too large:" - " xMin = %d, xMax = %d\n", - cbox.xMin >> 6, cbox.xMax >> 6 )); - error = FT_THROW( Raster_Overflow ); - goto Exit; - } - else - width = ( cbox.xMax - cbox.xMin ) >> 6; - - if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin ) - { - FT_ERROR(( "ft_smooth_render_generic: glyph too large:" - " yMin = %d, yMax = %d\n", - cbox.yMin >> 6, cbox.yMax >> 6 )); - error = FT_THROW( Raster_Overflow ); - goto Exit; - } - else - height = ( cbox.yMax - cbox.yMin ) >> 6; + width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6; + height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6; #ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING width_org = width; @@ -192,10 +173,10 @@ if ( vmul ) height *= 3; - x_shift = (FT_Int) cbox.xMin; - y_shift = (FT_Int) cbox.yMin; - x_left = (FT_Int)( cbox.xMin >> 6 ); - y_top = (FT_Int)( cbox.yMax >> 6 ); + x_shift = cbox.xMin; + y_shift = cbox.yMin; + x_left = cbox.xMin >> 6; + y_top = cbox.yMax >> 6; #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING @@ -222,8 +203,6 @@ #endif -#if FT_UINT_MAX > 0xFFFFU - /* Required check is (pitch * height < FT_ULONG_MAX), */ /* but we care realistic cases only. Always pitch <= width. */ if ( width > 0x7FFF || height > 0x7FFF ) @@ -234,8 +213,6 @@ goto Exit; } -#endif - bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->num_grays = 256; bitmap->width = width;