From 77f63d23f7d380b0ff02c18fd6a154ab9063128a Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Mon, 8 Jun 2009 15:18:21 +0200 Subject: Integrate FreeType 2.3.9 into the donut tree. This is done to get fixes for a few security-related issues. NOTE: the auto-hinter hasn't been changed to avoid modifying the rendering of characters. The 2.3.9 code contains minor fixes (not security-related) that could in theory do that (though extensive testing is needed to evaluate its real impact on Android). --- src/cff/cffload.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/cff/cffload.c') diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 9c030cf..22163fb 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -4,7 +4,7 @@ /* */ /* OpenType and CFF data/program tables loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 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, */ @@ -31,6 +31,7 @@ #if 1 + static const FT_UShort cff_isoadobe_charset[229] = { 0, 1, 2, 3, 4, 5, 6, 7, @@ -175,6 +176,7 @@ 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378 }; + #endif /* 1 */ @@ -317,7 +319,7 @@ static FT_Error cff_index_load_offsets( CFF_Index idx ) { - FT_Error error = 0; + FT_Error error = CFF_Err_Ok; FT_Stream stream = idx->stream; FT_Memory memory = stream->memory; @@ -400,6 +402,7 @@ old_offset = 1; for ( n = 0; n <= idx->count; n++ ) { + /* at this point, `idx->offsets' can't be NULL */ offset = idx->offsets[n]; if ( !offset ) offset = old_offset; @@ -1353,7 +1356,8 @@ FT_LOCAL_DEF( FT_Error ) cff_font_load( FT_Stream stream, FT_Int face_index, - CFF_Font font ) + CFF_Font font, + FT_Bool pure_cff ) { static const FT_Frame_Field cff_header_fields[] = { @@ -1517,7 +1521,7 @@ /* read the Charset and Encoding tables if available */ if ( font->num_glyphs > 0 ) { - FT_Bool invert = FT_BOOL( dict->cid_registry != 0xFFFFU ); + FT_Bool invert = FT_BOOL( dict->cid_registry != 0xFFFFU && pure_cff ); error = cff_charset_load( &font->charset, font->num_glyphs, stream, @@ -1537,9 +1541,6 @@ if ( error ) goto Exit; } - else - /* CID-keyed fonts only need CIDs */ - FT_FREE( font->charset.sids ); } /* get the font name (/CIDFontName for CID-keyed fonts, */ -- cgit v1.2.3