* src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables

with a zero length value.

* builds/beos/beos.mk: Include `link-std.mk'.

* src/type1/t1load.h (T1_Loader): Renamed to...
(T1_LoaderRec): This.
(T1_Loader): Now pointer to T1_LoaderRec.
* src/type1/t1load.c: Updated.

* include/freetype/internal/t1types.h, src/type1/t1load.c,
src/type1/t1objs.c:
s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
This commit is contained in:
Werner Lemberg 2002-05-12 19:59:17 +00:00
parent 95fcaf8df7
commit bd889e5de9
8 changed files with 105 additions and 80 deletions

View File

@ -1,3 +1,23 @@
2002-05-12 Owen Taylor <otaylor@redhat.com>
* src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables
with a zero length value.
2002-05-12 Michael Pfeiffer <michael.pfeiffer@utanet.at>
* builds/beos/beos.mk: Include `link-std.mk'.
2002-05-12 Werner Lemberg <wl@gnu.org>
* src/type1/t1load.h (T1_Loader): Renamed to...
(T1_LoaderRec): This.
(T1_Loader): Now pointer to T1_LoaderRec.
* src/type1/t1load.c: Updated.
* include/freetype/internal/t1types.h, src/type1/t1load.c,
src/type1/t1objs.c:
s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
2002-05-06 Werner Lemberg <wl@gnu.org>
* README: Add a note regarding libttf vs. libfreetype.

View File

@ -2,7 +2,7 @@
# FreeType 2 configuration rules for a BeOS system
#
# Copyright 1996-2000 by
# Copyright 1996-2000, 2002 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -13,6 +13,7 @@
include $(TOP)/builds/compiler/ansi-cc.mk
include $(TOP)/builds/beos/beos-def.mk
include $(TOP)/builds/link_std.mk
# EOF

View File

@ -81,7 +81,7 @@ FT_BEGIN_HEADER
T1_ENCODING_TYPE_ARRAY,
T1_ENCODING_TYPE_STANDARD,
T1_ENCODING_TYPE_ISOLATIN1,
T1_ENCODING_TYPE_EXPORT
T1_ENCODING_TYPE_EXPERT
} T1_EncodingType;

View File

@ -73,7 +73,9 @@
for ( ; entry < limit; entry++ )
{
if ( entry->Tag == tag )
/* For compatibility with Windows, we consider 0-length */
/* tables the same as missing tables. */
if ( entry->Tag == tag && entry->Length != 0 )
{
FT_TRACE3(( "found table.\n" ));
return entry;

View File

@ -379,7 +379,7 @@
static void
parse_blend_axis_types( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
FT_Int n, num_axis;
@ -441,7 +441,7 @@
static void
parse_blend_design_positions( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ];
FT_Int num_designs;
@ -523,7 +523,7 @@
static void
parse_blend_design_map( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
FT_Error error = 0;
T1_Parser parser = &loader->parser;
@ -604,7 +604,7 @@
static void
parse_weight_vector( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
FT_Error error = 0;
T1_Parser parser = &loader->parser;
@ -656,7 +656,7 @@
/* */
static void
parse_shared_dict( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
@ -689,7 +689,7 @@
static FT_Error
t1_load_keyword( T1_Face face,
T1_Loader* loader,
T1_Loader loader,
T1_Field field )
{
FT_Error error;
@ -767,7 +767,11 @@
/* Note: we must accept "+" as a valid character, as it is used in */
/* embedded type1 fonts in PDF documents. */
/* */
return ( ft_isalnum( c ) || c == '.' || c == '_' || c == '-' || c == '+' );
return ( ft_isalnum( c ) ||
c == '.' ||
c == '_' ||
c == '-' ||
c == '+' );
}
@ -815,7 +819,7 @@
static void
parse_font_name( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Error error;
@ -861,7 +865,7 @@
static void
parse_font_bbox( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Fixed temp[4];
@ -878,7 +882,7 @@
static void
parse_font_matrix( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Matrix* matrix = &face->type1.font_matrix;
@ -927,7 +931,7 @@
static void
parse_encoding( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Byte* cur = parser->root.cursor;
@ -1017,8 +1021,8 @@
{
if ( cur[1] == 'e' &&
cur[2] == 'f' &&
is_space(cur[-1]) &&
is_space(cur[3]) )
is_space( cur[-1] ) &&
is_space( cur[3] ) )
{
FT_TRACE6(( "encoding end\n" ));
break;
@ -1068,8 +1072,8 @@
face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;
parser->root.cursor = cur;
}
/* Otherwise, we should have either `StandardEncoding' or */
/* `ExpertEncoding' */
/* Otherwise, we should have either `StandardEncoding', */
/* `ExpertEncoding', or `ISOLatin1Encoding' */
else
{
if ( cur + 17 < limit &&
@ -1078,7 +1082,7 @@
else if ( cur + 15 < limit &&
ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 )
face->type1.encoding_type = T1_ENCODING_TYPE_EXPORT;
face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT;
else if ( cur + 18 < limit &&
ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 )
@ -1095,7 +1099,7 @@
static void
parse_subrs( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
PS_Table table = &loader->subrs;
@ -1192,7 +1196,7 @@
static void
parse_charstrings( T1_Face face,
T1_Loader* loader )
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
PS_Table code_table = &loader->charstrings;
@ -1241,8 +1245,8 @@
if ( error )
goto Fail;
n = 0;
for (;;)
{
FT_Int size;
@ -1480,7 +1484,7 @@
static FT_Error
parse_dict( T1_Face face,
T1_Loader* loader,
T1_Loader loader,
FT_Byte* base,
FT_Long size )
{
@ -1596,7 +1600,7 @@
static void
t1_init_loader( T1_Loader* loader,
t1_init_loader( T1_Loader loader,
T1_Face face )
{
FT_UNUSED( face );
@ -1616,7 +1620,7 @@
static void
t1_done_loader( T1_Loader* loader )
t1_done_loader( T1_Loader loader )
{
T1_Parser parser = &loader->parser;
@ -1636,7 +1640,7 @@
FT_LOCAL_DEF( FT_Error )
T1_Open_Face( T1_Face face )
{
T1_Loader loader;
T1_LoaderRec loader;
T1_Parser parser;
T1_Font type1 = &face->type1;
FT_Error error;
@ -1701,8 +1705,7 @@
loader.glyph_names.block = 0;
loader.glyph_names.elements = 0;
/* we must now build type1.encoding when we have a custom */
/* array.. */
/* we must now build type1.encoding when we have a custom array */
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
{
FT_Int charcode, idx, min_char, max_char;
@ -1740,8 +1743,8 @@
if ( ft_strcmp( (const char*)".notdef",
(const char*)glyph_name ) != 0 )
{
if (charcode < min_char) min_char = charcode;
if (charcode > max_char) max_char = charcode;
if ( charcode < min_char ) min_char = charcode;
if ( charcode > max_char ) max_char = charcode;
}
break;
}

View File

@ -48,7 +48,7 @@ FT_BEGIN_HEADER
PS_TableRec subrs;
FT_Bool fontdata;
} T1_Loader;
} T1_LoaderRec, *T1_Loader;
FT_LOCAL( FT_Error )

View File

@ -327,10 +327,9 @@
root->num_glyphs = face->type1.num_glyphs;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
if ( face->type1.font_info.is_fixed_pitch )
@ -462,7 +461,7 @@
clazz = cmap_classes->standard;
break;
case T1_ENCODING_TYPE_EXPORT:
case T1_ENCODING_TYPE_EXPERT:
charmap.encoding = ft_encoding_adobe_expert;
charmap.encoding_id = 1;
clazz = cmap_classes->expert;
@ -535,7 +534,7 @@
charmap->encoding_id = 0;
break;
case T1_ENCODING_TYPE_EXPORT:
case T1_ENCODING_TYPE_EXPERT:
charmap->encoding = ft_encoding_adobe_expert;
charmap->encoding_id = 1;
break;