aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/smooth/ftsmooth.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-16 19:26:40 +0000
committermarha <marha@users.sourceforge.net>2011-01-16 19:26:40 +0000
commit4e370208d0f941a4cceb6f9fefa78444c2bf3498 (patch)
tree543c693b5dee03c965b0c9ef79869a8536024432 /freetype/src/smooth/ftsmooth.c
parent1eaf4b3f1d746b054298358d81233364bb1b7ba2 (diff)
parent2177eb8fad173f2b0fe04f188c4d6dadaa8f4441 (diff)
downloadvcxsrv-4e370208d0f941a4cceb6f9fefa78444c2bf3498.tar.gz
vcxsrv-4e370208d0f941a4cceb6f9fefa78444c2bf3498.tar.bz2
vcxsrv-4e370208d0f941a4cceb6f9fefa78444c2bf3498.zip
svn merge ^/branches/released .
Diffstat (limited to 'freetype/src/smooth/ftsmooth.c')
-rw-r--r--freetype/src/smooth/ftsmooth.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/freetype/src/smooth/ftsmooth.c b/freetype/src/smooth/ftsmooth.c
index f71b4ee33..dc0235ad5 100644
--- a/freetype/src/smooth/ftsmooth.c
+++ b/freetype/src/smooth/ftsmooth.c
@@ -139,8 +139,26 @@
cbox.xMax = FT_PIX_CEIL( cbox.xMax );
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
- width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
- height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+ 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 ));
+ return Smooth_Err_Raster_Overflow;
+ }
+ else
+ width = (FT_UInt)( ( 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 ));
+ return Smooth_Err_Raster_Overflow;
+ }
+ else
+ height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+
bitmap = &slot->bitmap;
memory = render->root.memory;
@@ -201,7 +219,7 @@
/* but we care realistic cases only. Always pitch <= width. */
if ( width > 0x7FFFU || height > 0x7FFFU )
{
- FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n",
+ FT_ERROR(( "ft_smooth_render_generic: glyph too large: %u x %u\n",
width, height ));
return Smooth_Err_Raster_Overflow;
}