diff options
author | Werner Lemberg <wl@gnu.org> | 2011-10-01 09:25:55 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2011-10-01 09:25:55 +0200 |
commit | 9c98fbf634a83c6ea286395f0e788956eafd5aeb (patch) | |
tree | a46e11e2da05d64e4cd878223aa736e73397b557 /src/raster/ftrend1.c | |
parent | 6ae8bde444a7cd8bc4be537b02f39c3257ac5d64 (diff) | |
download | freetype2-9c98fbf634a83c6ea286395f0e788956eafd5aeb.tar.gz |
Handle some border cases.
* include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro.
* src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid
value of `target->rows'.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for
flex start.
* src/raster/ftrend1.c (ft_raster1_render): Check `width' and
`height'.
* src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against
invalid values in `localpoints' array.
Diffstat (limited to 'src/raster/ftrend1.c')
-rw-r--r-- | src/raster/ftrend1.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c index d8a89f28a..28b1b5897 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, */ @@ -176,6 +176,13 @@ 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; |