* src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c (T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for face == NULL. Suggested by Graham Asher.
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
diff --git a/ChangeLog b/ChangeLog
index f0c3119..1725a71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-03 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
+ (T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
+ face == NULL. Suggested by Graham Asher.
+
2007-06-03 Ismail Dönmez <ismail@pardus.org.tr>
* src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 4d3de71..fa08094 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -787,6 +787,9 @@
FT_Int n;
+ if ( !face )
+ return;
+
for ( n = 0; n < face->num_charmaps; n++ )
{
FT_CMap cmap = FT_CMAP( face->charmaps[n] );
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 095e7f1..3d08336 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -191,13 +191,11 @@
FT_LOCAL_DEF( void )
T1_Face_Done( T1_Face face )
{
- FT_Memory memory;
- T1_Font type1 = &face->type1;
-
-
if ( face )
{
- memory = face->root.memory;
+ FT_Memory memory = face->root.memory;
+ T1_Font type1 = &face->type1;
+
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
/* release multiple masters information */
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index d3d6024..d0251cf 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -386,13 +386,16 @@
static void
FNT_Face_Done( FNT_Face face )
{
- FT_Memory memory = FT_FACE_MEMORY( face );
+ if ( face )
+ {
+ FT_Memory memory = FT_FACE_MEMORY( face );
- fnt_font_done( face );
+ fnt_font_done( face );
- FT_FREE( face->root.available_sizes );
- face->root.num_fixed_sizes = 0;
+ FT_FREE( face->root.available_sizes );
+ face->root.num_fixed_sizes = 0;
+ }
}