smooth: Check glyph size by width/height, instead of pitch/height.

This commit is contained in:
suzuki toshiya 2009-07-09 17:21:32 +09:00
parent 8ad243bdcd
commit da59462780
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,15 @@
2009-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
smooth: Check glyph size by width/height, instead of pitch/height.
Suggested by der Mouse <mouse@Rodents-Montreal.ORG>.
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Improve
the check for too large glyph. Replace the pair of `pitch' and
`height' by the pair of `width' and `height'. `pitch' cannot
be greater than `height'. The required is checking the product
`pitch' * `height' <= FT_ULONG_MAX, but we use cheap checks for
the realistic case only.
2009-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Register 2 missing trace components, t1afm and ttbdf.
@ -957,7 +969,7 @@
Problem reported by Tavis Ormandy <taviso@google.com>.
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow
`width' or `pitch' to be larger than 0xFFFF.
`pitch' or `height' to be larger than 0xFFFF.
2009-03-20 Werner Lemberg <wl@gnu.org>
Tavis Ormandy <taviso@google.com>

View File

@ -196,7 +196,9 @@
#endif
if ( pitch > 0xFFFF || height > 0xFFFF )
/* Required check is ( pitch * height < FT_ULONG_MAX ), */
/* but we care realistic cases only. Always pitch <= width. */
if ( width > 0xFFFFU || height > 0xFFFFU )
{
FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n",
width, height ));