[raster, smooth] Directly test outline size (#47500).

This improves stand-alone compilation.

* src/base/ftoutln.c (FT_Outline_Render): Move cbox size test to...

* src/raster/ftraster.c (ft_black_render), src/smooth/ftgrays.c
(gray_raster_render): ...these functions.
2.6.5
Werner Lemberg 9 years ago
parent e9181aba2c
commit 31f2dc1946
  1. 11
      ChangeLog
  2. 6
      src/base/ftoutln.c
  3. 14
      src/raster/ftraster.c
  4. 14
      src/smooth/ftgrays.c

@ -1,3 +1,14 @@
2016-03-23 Werner Lemberg <wl@gnu.org>
[raster, smooth] Directly test outline size (#47500).
This improves stand-alone compilation.
* src/base/ftoutln.c (FT_Outline_Render): Move cbox size test to...
* src/raster/ftraster.c (ft_black_render), src/smooth/ftgrays.c
(gray_raster_render): ...these functions.
2016-03-23 Werner Lemberg <wl@gnu.org>
[raster, smooth] Fix some clang sanitizer runtime issues.

@ -618,7 +618,6 @@
FT_Error error;
FT_Renderer renderer;
FT_ListNode node;
FT_BBox cbox;
if ( !library )
@ -630,11 +629,6 @@
if ( !params )
return FT_THROW( Invalid_Argument );
FT_Outline_Get_CBox( outline, &cbox );
if ( cbox.xMin < -0x1000000L || cbox.yMin < -0x1000000L ||
cbox.xMax > 0x1000000L || cbox.yMax > 0x1000000L )
return FT_THROW( Invalid_Outline );
renderer = library->cur_renderer;
node = library->renderers.head;

@ -3175,6 +3175,20 @@
if ( !target_map->buffer )
return FT_THROW( Invalid );
/* reject too large outline coordinates */
{
FT_Vector* vec = outline->points;
FT_Vector* limit = vec + outline->n_points;
for ( ; vec < limit; vec++ )
{
if ( vec->x < -0x1000000L || vec->x > 0x1000000L ||
vec->y < -0x1000000L || vec->y > 0x1000000L )
return FT_THROW( Invalid );
}
}
ras.outline = *outline;
ras.target = *target_map;

@ -2074,6 +2074,20 @@ typedef ptrdiff_t FT_PtrDist;
if ( !( params->flags & FT_RASTER_FLAG_AA ) )
return FT_THROW( Invalid_Mode );
/* reject too large outline coordinates */
{
FT_Vector* vec = outline->points;
FT_Vector* limit = vec + outline->n_points;
for ( ; vec < limit; vec++ )
{
if ( vec->x < -0x1000000L || vec->x > 0x1000000L ||
vec->y < -0x1000000L || vec->y > 0x1000000L )
return FT_THROW( Invalid_Outline );
}
}
/* compute clipping box */
if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )
{

Loading…
Cancel
Save