Commit 45bb18fc7b8d9afa23fefa7b24e4c794594df32b

Werner Lemberg 2007-04-26T06:26:35

* src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to zero in case of error. This fixes Savannah bug #19689.

diff --git a/ChangeLog b/ChangeLog
index ae0f9f8..7769632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-26  Werner Lemberg  <wl@gnu.org>
+
+	* src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to
+	zero in case of error.  This fixes Savannah bug #19689.
+
 2007-04-10  Martin Horak  <horakm@centrum.cz>
 
 	* src/sfnt/sfobjs.c (sfnt_load_face) [FT_CONFIG_OPTION_INCREMENTAL]:
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index af0eadf..969c5db 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType convenience functions to handle glyphs (body).              */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -376,6 +376,8 @@
     const FT_Glyph_Class*  clazz;
 
 
+    *target = 0;
+
     /* check arguments */
     if ( !target || !source || !source->clazz )
     {
@@ -383,8 +385,6 @@
       goto Exit;
     }
 
-    *target = 0;
-
     clazz = source->clazz;
     error = ft_new_glyph( source->library, clazz, &copy );
     if ( error )