[cid] Fix parsing of subr offsets. Bug introduced 2016-05-16. * src/cid/cidparse.c (cid_parser_new): Fix off-by-one error.
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 44 45 46 47 48 49 50
diff --git a/ChangeLog b/ChangeLog
index 70ffa94..be85355 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-10-08 Werner Lemberg <wl@gnu.org>
+
+ [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 <wl@gnu.org>
[sfnt] Disable bitmap strikes if we don't have a bitmap data table.
diff --git a/docs/CHANGES b/docs/CHANGES
index c7c2cd4..f0eddc5 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -6,6 +6,9 @@ CHANGES BETWEEN 2.7 and 2.7.1
II. IMPORTANT BUG FIXES
+ - Handling of raw CID fonts was partially broken (bug introduced
+ in 2.6.4).
+
III. MISCELLANEOUS
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index 8dce7f9..1b27b2e 100644
--- 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;
}
}