Commit dd64a6227ceda32a90c06f77cf44e23dad95cb78

Werner Lemberg 2017-03-20T05:34:02

* src/cff/cffgload.c (cff_builder_init): Add safety guard (#50578).

diff --git a/ChangeLog b/ChangeLog
index 6a63518..04a1932 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-03-20  Werner Lemberg  <wl@gnu.org>
+
+	* src/cff/cffgload.c (cff_builder_init): Add safety guard (#50578).
+
 2017-03-18  Werner Lemberg  <wl@gnu.org>
 
 	Introduce FT_UINT_TO_POINTER macro (#50560).
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 4803b4b..9ead7d3 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -281,8 +281,11 @@
         CFF_Internal  internal = (CFF_Internal)size->root.internal;
 
 
-        builder->hints_globals = (void *)internal->topfont;
-        builder->hints_funcs   = glyph->root.internal->glyph_hints;
+        if ( internal )
+        {
+          builder->hints_globals = (void *)internal->topfont;
+          builder->hints_funcs   = glyph->root.internal->glyph_hints;
+        }
       }
     }