shithub: freetype+ttf2subf

Download patch

ref: e6699596af5c5d6f0ae0ea06e19df87dce088df8
parent: dadc50a4679c74ead5a283dd48a4164bc4a27cdd
author: Werner Lemberg <[email protected]>
date: Thu Feb 2 06:38:04 EST 2017

[truetype] Fix MVAR post-action handling.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=509

* src/truetype/ttobjs.c (tt_size_reset): Do nothing for CFF2.  This
is important to make `tt_size_reset_iterator' (called in
`tt_apply_mvar') always work.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2017-02-02  Werner Lemberg  <[email protected]>
 
+	[truetype] Fix MVAR post-action handling.
+
+	Reported as
+
+	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=509
+
+	* src/truetype/ttobjs.c (tt_size_reset): Do nothing for CFF2.  This
+	is important to make `tt_size_reset_iterator' (called in
+	`tt_apply_mvar') always work.
+
+2017-02-02  Werner Lemberg  <[email protected]>
+
 	Make compilation with FT_CONFIG_OPTION_PIC work again.
 
 	All code committed here is guarded with `FT_CONFIG_OPTION_PIC'.
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -1212,9 +1212,13 @@
     FT_Size_Metrics*  metrics;
 
 
-    size->ttmetrics.valid = FALSE;
-
     face = (TT_Face)size->root.face;
+
+    /* nothing to do for CFF2 */
+    if ( face->isCFF2 )
+      return FT_Err_Ok;
+
+    size->ttmetrics.valid = FALSE;
 
     metrics = &size->metrics;