X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fraster%2Fftrend1.c;h=859cb7d864f7c91a6cdaed76be10343f453506c2;hb=refs%2Fheads%2Fmaster;hp=1ed8af612175da4e741ff0e4bd7c1b8304243531;hpb=6941c0eff765270ceacc7e8975cd18bc03c8d1de;p=framework%2Fgraphics%2Ffreetype.git diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c index 1ed8af6..859cb7d 100644 --- a/src/raster/ftrend1.c +++ b/src/raster/ftrend1.c @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph rasterizer interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */ +/* Copyright 1996-2003, 2005, 2006, 2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -161,13 +161,28 @@ /* compute the control box, and grid fit it */ FT_Outline_Get_CBox( outline, &cbox ); + /* undocumented but confirmed: bbox values get rounded */ +#if 1 + cbox.xMin = FT_PIX_ROUND( cbox.xMin ); + cbox.yMin = FT_PIX_ROUND( cbox.yMin ); + cbox.xMax = FT_PIX_ROUND( cbox.xMax ); + cbox.yMax = FT_PIX_ROUND( cbox.yMax ); +#else cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); cbox.xMax = FT_PIX_CEIL( cbox.xMax ); cbox.yMax = FT_PIX_CEIL( cbox.yMax ); +#endif width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); + + if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX ) + { + error = Raster_Err_Invalid_Argument; + goto Exit; + } + bitmap = &slot->bitmap; memory = render->root.memory; @@ -229,10 +244,10 @@ } - FT_DEFINE_RENDERER(ft_raster1_renderer_class, - + FT_DEFINE_RENDERER( ft_raster1_renderer_class, + FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), + sizeof ( FT_RendererRec ), "raster1", 0x10000L, @@ -260,11 +275,10 @@ /* to register it by hand in your application. It should only be */ /* used for backwards-compatibility with FT 1.x anyway. */ /* */ - FT_DEFINE_RENDERER(ft_raster5_renderer_class, - - + FT_DEFINE_RENDERER( ft_raster5_renderer_class, + FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), + sizeof ( FT_RendererRec ), "raster5", 0x10000L,