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>.
This commit is contained in:
Werner Lemberg 2009-01-18 13:13:17 +00:00
parent 4f7ef401ea
commit 3739f8b987
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,12 @@
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.

View File

@ -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;