Blob Blame History Raw
From 29c759284e305ec428703c9a5831d0b1fc3497ef Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sat, 27 Jan 2018 14:43:43 +0100
Subject: [PATCH] * src/truetype/ttinterp.c (Ins_GETVARIATION): Avoid NULL
 reference.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5736
---
 src/truetype/ttinterp.c | 12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index d855aaaa9..551f14a2e 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -7470,8 +7470,16 @@
       return;
     }
 
-    for ( i = 0; i < num_axes; i++ )
-      args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+    if ( coords )
+    {
+      for ( i = 0; i < num_axes; i++ )
+        args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+    }
+    else
+    {
+      for ( i = 0; i < num_axes; i++ )
+        args[i] = 0;
+    }
   }
 
 
-- 
2.14.3