shithub: freetype+ttf2subf

Download patch

ref: f6ccb524af9b7d136f32426362558525b537817c
parent: 1fc776b5f14e2be6fa3d6573f5cd3fb88a7ae468
author: Werner Lemberg <wl@gnu.org>
date: Sun Jul 1 08:31:57 EDT 2018

* src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Guard SFNT function.

Reported by Behdad.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-01  Werner Lemberg  <wl@gnu.org>
+
+	* src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Guard SFNT function.
+
+	Reported by Behdad.
+
 2018-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	* src/base/fttrigon.c (FT_Tan): Improve accuracy.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -5493,10 +5493,17 @@
     ttface = (TT_Face)face;
     sfnt   = (SFNT_Service)ttface->sfnt;
 
-    return sfnt->get_colr_layer( ttface,
-                                 base_glyph,
-                                 acolor_index,
-                                 iterator );
+    if ( sfnt->get_colr_layer )
+      return sfnt->get_colr_layer( ttface,
+                                   base_glyph,
+                                   acolor_index,
+                                   iterator );
+    else
+    {
+      *acolor_index = 0;
+
+      return 0;
+    }
   }