From d2c55ab0e4ce435d3c6a2a99ab203a6802cdfd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzuki=2C=20Toshiya=20=28=E9=88=B4=E6=9C=A8=E4=BF=8A?= =?UTF-8?q?=E5=93=89=29?= Date: Fri, 15 Feb 2008 09:12:59 +0000 Subject: [PATCH] fix for inexistent sfnt ID in broken FOND --- ChangeLog | 12 ++++++++++++ builds/mac/ftmac.c | 2 +- src/base/ftmac.c | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9436303d..28723f05c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-02-15 suzuki toshiya + + * src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource + handle by its value instead of ResError(), fix provided by Deron + Kazmaier. According to Resource Manager Reference, GetResource(), + Get1Resource(), GetNamedResource(), Get1NamedResource() + and RGetResource() set noErr but returns NULL handle when they can + not find requested resource. These functions never return undefined + values, so it is sufficient to check if the handle is not NULL. + + * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto. + 2008-02-14 suzuki toshiya * src/base/ftbase.c: is replaced by "ftmac.c" as other diff --git a/builds/mac/ftmac.c b/builds/mac/ftmac.c index b83fecbed..b0b79ea1e 100644 --- a/builds/mac/ftmac.c +++ b/builds/mac/ftmac.c @@ -1207,7 +1207,7 @@ typedef short ResourceIndex; sfnt = GetResource( FT_MAKE_TAG( 's', 'f', 'n', 't' ), sfnt_id ); - if ( ResError() ) + if ( sfnt == NULL ) return FT_Err_Invalid_Handle; sfnt_size = (FT_ULong)GetHandleSize( sfnt ); diff --git a/src/base/ftmac.c b/src/base/ftmac.c index 1b9ffe9f1..8aa08c3c2 100644 --- a/src/base/ftmac.c +++ b/src/base/ftmac.c @@ -828,7 +828,7 @@ typedef short ResourceIndex; sfnt = GetResource( FT_MAKE_TAG( 's', 'f', 'n', 't' ), sfnt_id ); - if ( ResError() ) + if ( sfnt == NULL ) return FT_Err_Invalid_Handle; sfnt_size = (FT_ULong)GetHandleSize( sfnt );