Commit fc15ebe0a629acf769ed8976e3d5b84ee4e01236

Werner Lemberg 2022-03-21T11:15:41

* src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table. Fixes #1141.

diff --git a/src/sfnt/ttkern.c b/src/sfnt/ttkern.c
index 5634267..ca1c509 100644
--- a/src/sfnt/ttkern.c
+++ b/src/sfnt/ttkern.c
@@ -190,10 +190,16 @@
     FT_Int   result = 0;
     FT_UInt  count, mask;
 
-    FT_Byte*  p       = face->kern_table;
-    FT_Byte*  p_limit = p + face->kern_table_size;
+    FT_Byte*  p;
+    FT_Byte*  p_limit;
 
 
+    if ( !face->kern_table )
+      return result;
+
+    p       = face->kern_table;
+    p_limit = p + face->kern_table_size;
+
     p   += 4;
     mask = 0x0001;