* src/otvalid/otvmod.c, src/gxvalid/gxvmod.c: replace ft_validator_run by ft_setjmp
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
diff --git a/ChangeLog b/ChangeLog
index 3d33ae4..08f57da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-08-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ `ft_validator_run' wrapping `setjmp' can cause crash, found by Jens:
+ http://lists.nongnu.org/archive/html/freetype-devel/2006-08/msg00004.htm
+
+ * freetype2/src/otvalid/otvmod.c: replace `ft_validator_run' by
+ `ft_setjmp'. It reverts the change introduced on 2005-08-20.
+
+ * freetype2/src/gxvalid/gxvmod.c: Ditto.
+
2006-08-13 Jens Claudius <jens.claudius@yahoo.com>
* freetype2/include/freetype/internal/psaux.h: (enum T1_TokenType_):
diff --git a/src/gxvalid/gxvmod.c b/src/gxvalid/gxvmod.c
index 7bcfef4..c62a63a 100644
--- a/src/gxvalid/gxvmod.c
+++ b/src/gxvalid/gxvmod.c
@@ -91,7 +91,7 @@
{ \
ft_validator_init( &valid, _sfnt, _sfnt + len_ ## _sfnt, \
FT_VALIDATE_DEFAULT ); \
- if ( ft_validator_run( &valid ) == 0 ) \
+ if ( ft_setjmp( valid.jump_buffer ) == 0 ) \
gxv_ ## _sfnt ## _validate( _sfnt, face, &valid ); \
error = valid.error; \
if ( error ) \
@@ -210,7 +210,7 @@
{
ft_validator_init( &valid, ckern, ckern + len_ckern,
FT_VALIDATE_DEFAULT );
- if ( ft_validator_run( &valid ) == 0 )
+ if ( ft_setjmp( valid.jump_buffer ) == 0 )
gxv_kern_validate_classic( ckern, face,
ckern_flags & FT_VALIDATE_CKERN, &valid );
error = valid.error;
diff --git a/src/otvalid/otvmod.c b/src/otvalid/otvmod.c
index 4c46e6b..58f7eb7 100644
--- a/src/otvalid/otvmod.c
+++ b/src/otvalid/otvmod.c
@@ -124,7 +124,7 @@
if ( base )
{
ft_validator_init( &valid, base, base + len_base, FT_VALIDATE_DEFAULT );
- if ( ft_validator_run( &valid ) == 0 )
+ if ( ft_setjmp( valid.jump_buffer ) == 0 )
otv_BASE_validate( base, &valid );
error = valid.error;
if ( error )
@@ -134,7 +134,7 @@
if ( gpos )
{
ft_validator_init( &valid, gpos, gpos + len_gpos, FT_VALIDATE_DEFAULT );
- if ( ft_validator_run( &valid ) == 0 )
+ if ( ft_setjmp( valid.jump_buffer ) == 0 )
otv_GPOS_validate( gpos, face->num_glyphs, &valid );
error = valid.error;
if ( error )
@@ -144,7 +144,7 @@
if ( gsub )
{
ft_validator_init( &valid, gsub, gsub + len_gsub, FT_VALIDATE_DEFAULT );
- if ( ft_validator_run( &valid ) == 0 )
+ if ( ft_setjmp( valid.jump_buffer ) == 0 )
otv_GSUB_validate( gsub, face->num_glyphs, &valid );
error = valid.error;
if ( error )
@@ -154,7 +154,7 @@
if ( gdef )
{
ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT );
- if ( ft_validator_run( &valid ) == 0 )
+ if ( ft_setjmp( valid.jump_buffer ) == 0 )
otv_GDEF_validate( gdef, gsub, gpos, &valid );
error = valid.error;
if ( error )
@@ -164,7 +164,7 @@
if ( jstf )
{
ft_validator_init( &valid, jstf, jstf + len_jstf, FT_VALIDATE_DEFAULT );
- if ( ft_validator_run( &valid ) == 0 )
+ if ( ft_setjmp( valid.jump_buffer ) == 0 )
otv_JSTF_validate( jstf, gsub, gpos, face->num_glyphs, &valid );
error = valid.error;
if ( error )