* src/truetype/ttgload.c (load_truetype_glyph) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Call FT_GlyphLoader_CheckPoints before adding phantom points. This fixes a segfault bug with fonts (e.g. htst3.ttf) which have nested subglyphs more than one level deep. Reported by Anthony Fok. * include/freetype/config/ftoption.h: Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER, TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING, and TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to make it the new default.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
diff --git a/ChangeLog b/ChangeLog
index 997c728..578da91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2003-06-04 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttgload.c (load_truetype_glyph)
+ [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Call
+ FT_GlyphLoader_CheckPoints before adding phantom points. This fixes
+ a segfault bug with fonts (e.g. htst3.ttf) which have nested
+ subglyphs more than one level deep. Reported by Anthony Fok.
+
+ * include/freetype/config/ftoption.h: Define
+ TT_CONFIG_OPTION_BYTECODE_INTERPRETER,
+ TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING, and
+ TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to make it the new
+ default.
+
2003-06-03 Werner Lemberg <wl@gnu.org>
* src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index c55404b..21f2c9a 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -291,7 +291,7 @@ FT_BEGIN_HEADER
/* should define FT_DEBUG_MEMORY here. */
/* */
/* Note that the memory debugger is only activated at runtime when */
- /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */
+ /* when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
@@ -399,18 +399,19 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
-/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/
/* */
- /* Define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING to compile the */
- /* unpatented work-around hinting system. You must define this if you */
- /* want either to force the use of the unpatented hinting system by also */
- /* defining TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to */
- /* select it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */
+ /* Define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING (in addition to */
+ /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented */
+ /* work-around hinting system. You must define this if you want either */
+ /* to force the use of the unpatented hinting system by also defining */
+ /* TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to select */
+ /* it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */
/* */
-/* #define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING */
+#define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
/*************************************************************************/
@@ -423,7 +424,7 @@ FT_BEGIN_HEADER
/* For this to work you must also define */
/* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING. */
/* */
-/* #define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING */
+#define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING
/*************************************************************************/
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index c66050d..82ad8ab 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -779,6 +779,7 @@
FT_Bool glyph_data_loaded = 0;
#endif
+
if ( recurse_count >= TT_MAX_COMPOSITE_RECURSE )
{
error = TT_Err_Invalid_Composite;
@@ -1279,6 +1280,10 @@
if ( error )
goto Fail;
+ error = FT_GlyphLoader_CheckPoints( gloader, num_points + 2, 0 );
+ if ( error )
+ goto Fail;
+
/* prepare the execution context */
tt_prepare_zone( &exec->pts, &gloader->base,
start_point, start_contour );