Commit ed372b712fa698da24c21746135f2c2c8d738c6e

Alan Coopersmith 2014-03-09T06:14:12

Fix cppcheck 1.64 warning. * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer dereference in case of error.

diff --git a/ChangeLog b/ChangeLog
index a19fd6f..4d1d4bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-03-09  Alan Coopersmith  <alan.coopersmith@oracle.com>
+
+	Fix cppcheck 1.64 warning.
+
+	* src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer
+	dereference in case of error.
+
 2014-03-09  Sean McBride  <sean@rogue-research.com>
 
 	* src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning.
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index 7aa2e11..74e8a72 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -332,8 +332,8 @@
       af_face_globals_free( globals );
       globals = NULL;
     }
-
-    globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX;
+    else
+      globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX;
 
   Exit:
     *aglobals = globals;