Commit 19b42a5c3aadaebb60599e594965e5968f822da1

Werner Lemberg 2004-05-10T20:54:27

* src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix error handling.

diff --git a/ChangeLog b/ChangeLog
index 2ba5d12..3e76030 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-09  George Williams  <gww@silcom.com>
+
+	* src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix
+	error handling.
+
 2004-05-07  Werner Lemberg  <wl@gnu.org>
 
 	* src/pfr/pfrobjs.c, src/pfr/pfrobjs.h (pfr_face_init,
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 09f06b8..820eeb1 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -294,7 +294,7 @@
 
     if ( version != 0x00010000L                       ||
          axisCount != (FT_Long)blend->mmvar->num_axis )
-      return;
+      goto Exit;
 
     if ( FT_NEW_ARRAY( blend->avar_segment, axisCount ) )
       goto Exit;
@@ -1451,9 +1451,6 @@
       FT_Stream_SeekSet( stream, here );
     }
 
-    FT_FRAME_EXIT();
-    goto Exit;
-
   Fail3:
     FT_FREE( tuple_coords );
     FT_FREE( im_start_coords );
@@ -1463,8 +1460,11 @@
     FT_FRAME_EXIT();
 
   Fail1:
-    FT_FREE( delta_xy );
-    *deltas = NULL;
+    if ( error )
+    {
+      FT_FREE( delta_xy );
+      *deltas = NULL;
+    }
 
   Exit:
     return error;