Protect FT_Get_Next_Char. * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to change from 2008-07-22. Patch from Ronen Ghoshal <rghoshal@emtex.com>.
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
diff --git a/ChangeLog b/ChangeLog
index db314b2..911d48b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-01-18 Werner Lemberg <wl@gnu.org>
+ Protect FT_Get_Next_Char.
+
+ * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to
+ change from 2008-07-22.
+
+ Patch from Ronen Ghoshal <rghoshal@emtex.com>.
+
+2009-01-18 Werner Lemberg <wl@gnu.org>
+
Implement FT_Get_Name_Index for SFNT driver.
* src/sfnt/sfdriver.c (sfnt_get_name_index): New function.
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index efd079f..67b6684 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
+/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -697,6 +697,14 @@
p += num_ranges * 2;
offset = FT_PEEK_USHORT( p );
+ /* some fonts handle the last segment incorrectly; */
+ /* we have to catch it */
+ if ( range_index >= num_ranges - 1 &&
+ cmap->cur_start == 0xFFFFU &&
+ cmap->cur_end == 0xFFFFU &&
+ cmap->cur_delta == 0x1U )
+ offset = 0;
+
if ( offset != 0xFFFFU )
{
cmap->cur_values = offset ? p + offset : NULL;