shithub: freetype+ttf2subf

Download patch

ref: 0bf95b585e5a44e6999ebd54ad2b1913e5e885a8
parent: d9ff6f20ad3e5101dbed0164cbed10e0d0c26792
author: Dave Arnold <[email protected]>
date: Fri Mar 17 03:22:55 EDT 2017

[cff] Fix CFF2 stack allocation.

* src/cff/cffparse.c (cff_parser_init) add 1 for operator.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-03-17  Dave Arnold <[email protected]>
+
+	[cff] Fix CFF2 stack allocation.
+
+	* src/cff/cffparse.c (cff_parser_init) add 1 for operator.
+
 2017-03-16  Werner Lemberg  <[email protected]>
 
 	* src/truetype/ttgxvar.c (tt_done_blend): Free `vvar_table'.
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1890,7 +1890,8 @@
     subfont->lenNDV = lenNDV;
     subfont->NDV    = NDV;
 
-    stackSize = font->cff2 ? font->top_font.font_dict.maxstack
+    /* add 1 for the operator */
+    stackSize = font->cff2 ? font->top_font.font_dict.maxstack + 1
                            : CFF_MAX_STACK_DEPTH + 1;
 
     if ( cff_parser_init( &parser,