Remove all code related to FT_MAX_CHARMAP_CACHEABLE.

This is no longer used.

* src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c,
src/sfnt/ttcmap.c: Do it.
This commit is contained in:
Werner Lemberg 2014-11-24 17:16:08 +01:00
parent f0292bb992
commit 6889f7b72d
5 changed files with 10 additions and 87 deletions

View File

@ -1,3 +1,12 @@
2014-11-24 Werner Lemberg <wl@gnu.org>
Remove all code related to FT_MAX_CHARMAP_CACHEABLE.
This is no longer used.
* src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c,
src/sfnt/ttcmap.c: Do it.
2014-11-24 Werner Lemberg <wl@gnu.org>
[sfnt] Fix Savannah bug #43680.

View File

@ -1040,14 +1040,6 @@
( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) )
{
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( cur - first > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "find_unicode_charmap: UCS-4 cmap is found "
"at too late position (%d)\n", cur - first ));
continue;
}
#endif
face->charmap = cur[0];
return FT_Err_Ok;
}
@ -1062,14 +1054,6 @@
{
if ( cur[0]->encoding == FT_ENCODING_UNICODE )
{
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( cur - first > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "find_unicode_charmap: UCS-2 cmap is found "
"at too late position (%d)\n", cur - first ));
continue;
}
#endif
face->charmap = cur[0];
return FT_Err_Ok;
}
@ -1111,17 +1095,7 @@
if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR &&
FT_Get_CMap_Format( cur[0] ) == 14 )
{
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( cur - first > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "find_unicode_charmap: UVS cmap is found "
"at too late position (%d)\n", cur - first ));
continue;
}
#endif
return cur[0];
}
}
return NULL;
@ -3122,15 +3096,6 @@
{
if ( cur[0]->encoding == encoding )
{
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "FT_Select_Charmap: requested charmap is found (%d), "
"but in too late position to cache\n",
cur - face->charmaps ));
continue;
}
#endif
face->charmap = cur[0];
return 0;
}
@ -3165,15 +3130,6 @@
{
if ( cur[0] == charmap )
{
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "FT_Set_Charmap: requested charmap is found (%d), "
"but in too late position to cache\n",
cur - face->charmaps ));
continue;
}
#endif
face->charmap = cur[0];
return 0;
}
@ -3199,15 +3155,6 @@
FT_ASSERT( i < charmap->face->num_charmaps );
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( i > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "FT_Get_Charmap_Index: requested charmap is found (%d), "
"but in too late position to cache\n",
i ));
return -i;
}
#endif
return i;
}

6
src/cache/ftccmap.c vendored
View File

@ -301,12 +301,6 @@
if ( error )
goto Exit;
#ifdef FT_MAX_CHARMAP_CACHEABLE
/* something rotten can happen with rogue clients */
if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE )
return 0; /* XXX: should return appropriate error */
#endif
if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps )
{
FT_CharMap old, cmap = NULL;

View File

@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (body). */
/* */
/* Copyright 1996-2013 by */
/* Copyright 1996-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -943,16 +943,6 @@
if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
goto Exit;
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "cff_face_init: no Unicode cmap is found, "
"and too many subtables (%d) to add synthesized cmap\n",
nn ));
goto Exit;
}
#endif
/* we didn't find a Unicode charmap -- synthesize one */
cmaprec.face = cffface;
cmaprec.platform_id = TT_PLATFORM_MICROSOFT;
@ -973,15 +963,6 @@
cffface->charmap = cffface->charmaps[nn];
Skip_Unicode:
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( nn > FT_MAX_CHARMAP_CACHEABLE )
{
FT_ERROR(( "cff_face_init: Unicode cmap is found, "
"but too many preceding subtables (%d) to access\n",
nn - 1 ));
goto Exit;
}
#endif
if ( encoding->count > 0 )
{
FT_CMap_Class clazz;

View File

@ -3502,14 +3502,6 @@
num_cmaps = TT_NEXT_USHORT( p );
#ifdef FT_MAX_CHARMAP_CACHEABLE
if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE )
FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables (%d)\n"
" subtable #%d and higher are loaded"
" but cannot be searched\n",
num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 ));
#endif
for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- )
{
FT_CharMapRec charmap;