shithub: freetype+ttf2subf

Download patch

ref: d61b042568d395ef7d55d0475db9203ae0f6b3cf
parent: fcc0ee80e1f31d4f215a08cc7f1066218176495b
author: Werner Lemberg <[email protected]>
date: Sat Oct 8 15:20:33 EDT 2016

[cid] Fix parsing of subr offsets.

Bug introduced 2016-05-16.

* src/cid/cidparse.c (cid_parser_new): Fix off-by-one error.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-10-08  Werner Lemberg  <[email protected]>
+
+	[cid] Fix parsing of subr offsets.
+
+	Bug introduced 2016-05-16.
+
+	* src/cid/cidparse.c (cid_parser_new): Fix off-by-one error.
+
 2016-10-01  Werner Lemberg  <[email protected]>
 
 	[sfnt] Disable bitmap strikes if we don't have a bitmap data table.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -6,6 +6,9 @@
 
   II. IMPORTANT BUG FIXES
 
+    - Handling of  raw CID fonts was partially  broken (bug introduced
+      in 2.6.4).
+
 
   III. MISCELLANEOUS
 
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -138,13 +138,13 @@
                ft_strncmp( (char*)p, STARTDATA, STARTDATA_LEN ) == 0 )
           {
             /* save offset of binary data after `StartData' */
-            offset += (FT_ULong)( p - buffer ) + STARTDATA_LEN;
+            offset += (FT_ULong)( p - buffer ) + STARTDATA_LEN + 1;
             goto Found;
           }
           else if ( p[1] == 's'                                   &&
                     ft_strncmp( (char*)p, SFNTS, SFNTS_LEN ) == 0 )
           {
-            offset += (FT_ULong)( p - buffer ) + SFNTS_LEN;
+            offset += (FT_ULong)( p - buffer ) + SFNTS_LEN + 1;
             goto Found;
           }
         }