shithub: freetype+ttf2subf

Download patch

ref: 5081674c5f3c2c7bcf49bc48f8618dd091325c9d
parent: 577414030a14219723d0536fb1a349174508062b
author: Werner Lemberg <[email protected]>
date: Sat Oct 22 15:16:08 EDT 2016

[truetype] Fix SCANTYPE instruction (#49394).

* src/truetype/ttinterp.c (Ins_SCANTYPE): Only use lower 16bits.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2016-10-22  Werner Lemberg  <[email protected]>
 
+	[truetype] Fix SCANTYPE instruction (#49394).
+
+	* src/truetype/ttinterp.c (Ins_SCANTYPE): Only use lower 16bits.
+
+2016-10-22  Werner Lemberg  <[email protected]>
+
 	[sfnt] Improve handling of invalid post 2.5 tables [#49393].
 
 	* src/sfnt/ttpost.c (load_format_25): We need at least a single
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -5173,7 +5173,7 @@
   /*                                                                       */
   /* SCANTYPE[]:   SCAN TYPE                                               */
   /* Opcode range: 0x8D                                                    */
-  /* Stack:        uint32? -->                                             */
+  /* Stack:        uint16 -->                                              */
   /*                                                                       */
   static void
   Ins_SCANTYPE( TT_ExecContext  exc,
@@ -5180,7 +5180,7 @@
                 FT_Long*        args )
   {
     if ( args[0] >= 0 )
-      exc->GS.scan_type = (FT_Int)args[0];
+      exc->GS.scan_type = (FT_Int)args[0] & 0xFFFFU;
   }