diff options
author | Makoto Onuki <omakoto@google.com> | 2015-06-09 16:35:08 -0700 |
---|---|---|
committer | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2015-08-19 11:42:11 -0700 |
commit | a3a6685e80688af254c5c23a62a2f3b0bcef5e5f (patch) | |
tree | 7e67208cafc4572557e8d10469fb5dc173ca2edf /src/psaux/psobjs.c | |
parent | 6bb07037be23a1523b3af5b1be5432bd4ccf22b7 (diff) | |
download | android_external_freetype-a3a6685e80688af254c5c23a62a2f3b0bcef5e5f.tar.gz android_external_freetype-a3a6685e80688af254c5c23a62a2f3b0bcef5e5f.tar.bz2 android_external_freetype-a3a6685e80688af254c5c23a62a2f3b0bcef5e5f.zip |
Update to freetype 2.6.0stable/cm-11.0-XNG3C
Bug 18751561
RM-154
Change-Id: Ia8c081f8fd38a1f78c72d30234c5ace8cfffe6a9
(cherry picked from commit c341565733345bef8ebe68db3c175301afe4ec97)
Diffstat (limited to 'src/psaux/psobjs.c')
-rw-r--r-- | src/psaux/psobjs.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c index b4b7d45..c7cbc67 100644 --- a/src/psaux/psobjs.c +++ b/src/psaux/psobjs.c @@ -4,7 +4,7 @@ /* */ /* Auxiliary functions for PostScript fonts (body). */ /* */ -/* Copyright 1996-2014 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -81,7 +81,7 @@ table->max_elems = count; table->init = 0xDEADBEEFUL; table->num_elems = 0; - table->block = 0; + table->block = NULL; table->capacity = 0; table->cursor = 0; @@ -165,10 +165,10 @@ /* reallocation fails. */ /* */ FT_LOCAL_DEF( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_PtrDist length ) + ps_table_add( PS_Table table, + FT_Int idx, + void* object, + FT_UInt length ) { if ( idx < 0 || idx >= table->max_elems ) { @@ -176,12 +176,6 @@ return FT_THROW( Invalid_Argument ); } - if ( length < 0 ) - { - FT_ERROR(( "ps_table_add: invalid length\n" )); - return FT_THROW( Invalid_Argument ); - } - /* grow the base block if needed */ if ( table->cursor + length > table->capacity ) { @@ -625,8 +619,8 @@ token->type = T1_TOKEN_TYPE_NONE; - token->start = 0; - token->limit = 0; + token->start = NULL; + token->limit = NULL; /* first of all, skip leading whitespace */ ps_parser_skip_spaces( parser ); @@ -707,7 +701,7 @@ if ( !token->limit ) { - token->start = 0; + token->start = NULL; token->type = T1_TOKEN_TYPE_NONE; } @@ -932,7 +926,7 @@ FT_Memory memory ) { FT_Byte* cur = *cursor; - FT_PtrDist len = 0; + FT_UInt len = 0; FT_Int count; FT_String* result; FT_Error error; @@ -972,7 +966,7 @@ } } - len = cur - *cursor; + len = (FT_UInt)( cur - *cursor ); if ( cur >= limit || FT_ALLOC( result, len + 1 ) ) return 0; @@ -1230,7 +1224,7 @@ for ( i = 0; i < 4; i++ ) { - result = ps_tofixedarray( &cur, limit, max_objects, + result = ps_tofixedarray( &cur, limit, (FT_Int)max_objects, temp + i * max_objects, 0 ); if ( result < 0 || (FT_UInt)result < max_objects ) { @@ -1321,7 +1315,7 @@ goto Exit; } if ( (FT_UInt)num_elements > field->array_max ) - num_elements = field->array_max; + num_elements = (FT_Int)field->array_max; old_cursor = parser->cursor; old_limit = parser->limit; @@ -1338,7 +1332,15 @@ { parser->cursor = token->start; parser->limit = token->limit; - ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 ); + + error = ps_parser_load_field( parser, + &fieldrec, + objects, + max_objects, + 0 ); + if ( error ) + break; + fieldrec.offset += fieldrec.size; } @@ -1371,7 +1373,7 @@ ps_parser_to_bytes( PS_Parser parser, FT_Byte* bytes, FT_Offset max_bytes, - FT_Long* pnum_bytes, + FT_ULong* pnum_bytes, FT_Bool delimiters ) { FT_Error error = FT_Err_Ok; @@ -1545,7 +1547,7 @@ FT_GlyphLoader_Rewind( loader ); builder->hints_globals = size->internal; - builder->hints_funcs = 0; + builder->hints_funcs = NULL; if ( hinting ) builder->hints_funcs = glyph->internal->glyph_hints; |