From e05861b9dace89db68d7e1a3ade9063c16fb5d3c Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Thu, 9 Jul 2009 14:43:57 +0900 Subject: [PATCH 1/3] Register 2 missing trace components, t1afm and ttbdf. --- ChangeLog | 8 ++++++++ include/freetype/internal/fttrace.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index c029c33d9..e172785ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-09 suzuki toshiya + + Register 2 missing trace components, t1afm and ttbdf. + + * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( t1afm ) + and FT_TRACE_DEF( ttbdf ). See + http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html + 2009-07-09 suzuki toshiya Register a trace component for ftgloadr.c. diff --git a/include/freetype/internal/fttrace.h b/include/freetype/internal/fttrace.h index a626971ca..30eb6550c 100644 --- a/include/freetype/internal/fttrace.h +++ b/include/freetype/internal/fttrace.h @@ -49,6 +49,7 @@ FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */ FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ +FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ /* TrueType driver components */ FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ @@ -59,6 +60,7 @@ FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */ FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */ /* Type 1 driver components */ +FT_TRACE_DEF( t1afm ) FT_TRACE_DEF( t1driver ) FT_TRACE_DEF( t1gload ) FT_TRACE_DEF( t1hint ) From 8ad243bdcd033cc2cb17f3c11b49e89ecee9ba30 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Thu, 9 Jul 2009 16:12:30 +0900 Subject: [PATCH 2/3] Shorten URLs referring ft-devel archive. --- ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e172785ec..e84dd0b0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,8 +18,8 @@ Prevent the overflows by a glyph with too many points or contours. The bug is reported by Boris Letocha . See - http://lists.nongnu.org/archive/html/freetype-devel/2009-06/msg00031.html - http://lists.nongnu.org/archive/html/freetype-devel/2009-07/msg00002.html + http://lists.gnu.org/archive/html/freetype-devel/2009-06/msg00031.html + http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00002.html * include/freetype/ftimage.h (FT_OUTLINE_CONTOURS_MAX, FT_OUTLINE_POINTS_MAX): New macros to declare the maximum @@ -5567,7 +5567,7 @@ `ft_validator_run' wrapping `setjmp' can cause a crash, as found by Jens: - http://lists.nongnu.org/archive/html/freetype-devel/2006-08/msg00004.htm. + http://lists.gnu.org/archive/html/freetype-devel/2006-08/msg00004.htm. * src/otvalid/otvmod.c: Replace `ft_validator_run' by `ft_setjmp'. It reverts the change introduced on 2005-08-20. @@ -5764,7 +5764,7 @@ 2006-06-24 Eugeniy Meshcheryakov Fix two hinting bugs as reported in - http://lists.nongnu.org/archive/html/freetype-devel/2006-06/msg00057.html. + http://lists.gnu.org/archive/html/freetype-devel/2006-06/msg00057.html. * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add `first_point' member. From da5946278048ca97594120b23b47adb43095503b Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Thu, 9 Jul 2009 17:21:32 +0900 Subject: [PATCH 3/3] smooth: Check glyph size by width/height, instead of pitch/height. --- ChangeLog | 14 +++++++++++++- src/smooth/ftsmooth.c | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e84dd0b0c..b74dc22cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-07-09 suzuki toshiya + + smooth: Check glyph size by width/height, instead of pitch/height. + Suggested by der Mouse . + + * 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 Register 2 missing trace components, t1afm and ttbdf. @@ -957,7 +969,7 @@ Problem reported by Tavis Ormandy . * 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 Tavis Ormandy diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index f0b0513a4..a47c97a22 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -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 ));