[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/ChangeLog b/ChangeLog
index 0b9c42b..bec432e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2017-02-02 Werner Lemberg <wl@gnu.org>
+ [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 <wl@gnu.org>
+
Make compilation with FT_CONFIG_OPTION_PIC work again.
All code committed here is guarded with `FT_CONFIG_OPTION_PIC'.
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 18aa48a..00207bb 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -1212,10 +1212,14 @@
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;
/* copy the result from base layer */