diff options
author | David 'Digit' Turner <digit@google.com> | 2011-01-26 13:53:40 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2011-01-26 13:53:40 +0100 |
commit | 7f08cbd7d6dcf19b8d8e4328e33032aee342e3b4 (patch) | |
tree | f9ed9e041d6830735eae3d4af62e9a602851faea /src/base/ftobjs.c | |
parent | cb487e4c5295d0d9bb96ddd3a27372ffad41ae5b (diff) | |
download | android_external_freetype-7f08cbd7d6dcf19b8d8e4328e33032aee342e3b4.tar.gz android_external_freetype-7f08cbd7d6dcf19b8d8e4328e33032aee342e3b4.tar.bz2 android_external_freetype-7f08cbd7d6dcf19b8d8e4328e33032aee342e3b4.zip |
Upgrade to upstream 2.4.4
This is necessary to fix several security issues. See b/3344697
Change-Id: Ica5c6387fbd791008199f7994ed03978ed700a69
Diffstat (limited to 'src/base/ftobjs.c')
-rw-r--r-- | src/base/ftobjs.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 7f38df0..cb44b8c 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -1062,6 +1062,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 ) { @@ -1071,6 +1072,7 @@ } #endif return cur[0]; + } } return NULL; @@ -1849,6 +1851,7 @@ char * file_names[FT_RACCESS_N_RULES]; FT_Long offsets[FT_RACCESS_N_RULES]; FT_Error errors[FT_RACCESS_N_RULES]; + FT_Bool is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */ FT_Open_Args args2; FT_Stream stream2 = 0; @@ -1859,6 +1862,15 @@ for ( i = 0; i < FT_RACCESS_N_RULES; i++ ) { + is_darwin_vfs = raccess_rule_by_darwin_vfs( i ); + if ( is_darwin_vfs && vfs_rfork_has_no_font ) + { + FT_TRACE3(( "Skip rule %d: darwin vfs resource fork" + " is already checked and" + " no font is found\n", i )); + continue; + } + if ( errors[i] ) { FT_TRACE3(( "Error[%d] has occurred in rule %d\n", errors[i], i )); @@ -1872,6 +1884,9 @@ i, args2.pathname, offsets[i] )); error = FT_Stream_New( library, &args2, &stream2 ); + if ( is_darwin_vfs && error == FT_Err_Cannot_Open_Stream ) + vfs_rfork_has_no_font = TRUE; + if ( error ) { FT_TRACE3(( "failed\n" )); @@ -1886,6 +1901,8 @@ if ( !error ) break; + else if ( is_darwin_vfs ) + vfs_rfork_has_no_font = TRUE; } for (i = 0; i < FT_RACCESS_N_RULES; i++) |