diff options
author | Nick Kralevich <nnk@google.com> | 2010-09-14 17:02:58 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2010-09-15 10:32:30 -0700 |
commit | aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c (patch) | |
tree | 2b4c5412391bf31f6a54b237ea83bfde05ec3802 /src/sfnt/ttcmap.c | |
parent | d4476115dee94297c020b3a2b067188117424e25 (diff) | |
download | android_external_freetype-aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c.tar.gz android_external_freetype-aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c.tar.bz2 android_external_freetype-aacb8e1368a883fcbc9fe64fd0e460cef9c9b20c.zip |
upgrade freetype to 2.4.2.
Bug: 2969145
Change-Id: I8debbbe0bd478d9cf8c39cff5179981b5f3b371a
Diffstat (limited to 'src/sfnt/ttcmap.c')
-rw-r--r-- | src/sfnt/ttcmap.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index b283f6d..544750a 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, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -2689,7 +2689,7 @@ FT_Memory memory ) { FT_UInt32 old_max = cmap->max_results; - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; if ( num_results > cmap->max_results ) @@ -2787,7 +2787,8 @@ } /* and the non-default table (these glyphs are specified here) */ - if ( nondefOff != 0 ) { + if ( nondefOff != 0 ) + { FT_Byte* ndp = table + nondefOff; FT_ULong numMappings = TT_NEXT_ULONG( ndp ); FT_ULong i, lastUni = 0; @@ -3375,7 +3376,7 @@ clazz[i] = NULL; *output_class = clazz; - return FT_Err_Ok; + return SFNT_Err_Ok; } #endif /*FT_CONFIG_OPTION_PIC*/ @@ -3391,11 +3392,12 @@ FT_Byte* limit = table + face->cmap_size; FT_UInt volatile num_cmaps; FT_Byte* volatile p = table; - FT_Library library = FT_FACE_LIBRARY(face); - FT_UNUSED(library); + FT_Library library = FT_FACE_LIBRARY( face ); + + FT_UNUSED( library ); - if ( p + 4 > limit ) + if ( !p || p + 4 > limit ) return SFNT_Err_Invalid_Table; /* only recognize format 0 */ @@ -3409,6 +3411,12 @@ } 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) " + "subtable#%d and later are loaded but cannot be searched\n", + num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 )); +#endif for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) { |