From ae02ed7473efe652a44e44906111ffa8d0de4c6f Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Fri, 18 Apr 2003 16:59:36 +0000 Subject: Add patch to avoid dereferencing a NULL pointer in freetype2. This fixes a crash with certain monotype fonts such as the Windows FixedSys fonts. Note, the real fix should go into freetype2, but I'm still waiting for feedback from them. Obtained from: Fontconfig CVS --- x11-fonts/fontconfig/Makefile | 1 + x11-fonts/fontconfig/files/patch-src_fcfreetype.c | 46 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 x11-fonts/fontconfig/files/patch-src_fcfreetype.c (limited to 'x11-fonts') diff --git a/x11-fonts/fontconfig/Makefile b/x11-fonts/fontconfig/Makefile index 295c1bd9fa1e..b717bf2445b4 100644 --- a/x11-fonts/fontconfig/Makefile +++ b/x11-fonts/fontconfig/Makefile @@ -7,6 +7,7 @@ PORTNAME= fontconfig PORTVERSION= 2.1.94 +PORTREVISION= 1 CATEGORIES= x11-fonts MASTER_SITES= http://www.fontconfig.org/release/ \ http://nexp.cs.pdx.edu/fontconfig/release/ diff --git a/x11-fonts/fontconfig/files/patch-src_fcfreetype.c b/x11-fonts/fontconfig/files/patch-src_fcfreetype.c new file mode 100644 index 000000000000..e28b4f4dc0fc --- /dev/null +++ b/x11-fonts/fontconfig/files/patch-src_fcfreetype.c @@ -0,0 +1,46 @@ +--- src/fcfreetype.c 2003/04/16 18:08:47 1.23 ++++ src/fcfreetype.c 2003/04/18 15:56:05 1.25 +@@ -55,9 +55,15 @@ + #include + #include + +-#if (FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3)) ++#if (FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 4)) + #include ++#include + #define USE_FTBDF ++#define HAS_BDF_PROPERTY(f) ((f) && (f)->driver && \ ++ (f)->driver->root.clazz->get_interface) ++#define MY_Get_BDF_Property(f,n,p) (HAS_BDF_PROPERTY(f) ? \ ++ FT_Get_BDF_Property(f,n,p) : \ ++ FT_Err_Invalid_Argument) + #endif + + +@@ -781,7 +787,7 @@ + { + int rc; + BDF_PropertyRec prop; +- rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop); ++ rc = MY_Get_BDF_Property(face, "FOUNDRY", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) + foundry = prop.u.atom; + } +@@ -789,7 +795,7 @@ + if (width == -1) + { + BDF_PropertyRec prop; +- if (FT_Get_BDF_Property(face, "RELATIVE_SETWIDTH", &prop) == 0 && ++ if (MY_Get_BDF_Property(face, "RELATIVE_SETWIDTH", &prop) == 0 && + (prop.type == BDF_PROPERTY_TYPE_INTEGER || + prop.type == BDF_PROPERTY_TYPE_CARDINAL)) + { +@@ -811,7 +817,7 @@ + case 9: width = FC_WIDTH_ULTRAEXPANDED; break; + } + } +- else if (FT_Get_BDF_Property (face, "SETWIDTH_NAME", &prop) == 0 && ++ else if (MY_Get_BDF_Property (face, "SETWIDTH_NAME", &prop) == 0 && + prop.type == BDF_PROPERTY_TYPE_ATOM) + { + static struct { -- cgit v1.2.3