From 462f18c7b25fe3e467f837647d07ab0a78aa8d2b Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 22 Feb 2015 21:39:56 +0100 Subject: Merged origin/release (checked in because wanted to merge new stuff) --- freetype/src/psaux/psconv.c | 9 +++++---- freetype/src/psaux/psobjs.c | 10 +++++++++- freetype/src/psaux/t1cmap.c | 22 ++++++++++++++++++---- freetype/src/psaux/t1decode.c | 12 +++++++----- 4 files changed, 39 insertions(+), 14 deletions(-) (limited to 'freetype/src/psaux') diff --git a/freetype/src/psaux/psconv.c b/freetype/src/psaux/psconv.c index 9db8d67a6..36517e7ae 100644 --- a/freetype/src/psaux/psconv.c +++ b/freetype/src/psaux/psconv.c @@ -124,7 +124,7 @@ if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) break; - c = ft_char_table[*p & 0x7f]; + c = ft_char_table[*p & 0x7F]; if ( c < 0 || c >= base ) break; @@ -245,12 +245,13 @@ if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) break; - c = ft_char_table[*p & 0x7f]; + c = ft_char_table[*p & 0x7F]; if ( c < 0 || c >= 10 ) break; - if ( decimal < 0xCCCCCCCL ) + /* only add digit if we don't overflow */ + if ( divider < 0xCCCCCCCL && decimal < 0xCCCCCCCL ) { decimal = decimal * 10 + c; @@ -520,7 +521,7 @@ if ( *p OP 0x80 ) break; - c = ft_char_table[*p & 0x7f]; + c = ft_char_table[*p & 0x7F]; if ( (unsigned)c >= 16 ) break; diff --git a/freetype/src/psaux/psobjs.c b/freetype/src/psaux/psobjs.c index 524eb7771..8031c0660 100644 --- a/freetype/src/psaux/psobjs.c +++ b/freetype/src/psaux/psobjs.c @@ -1338,7 +1338,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; } diff --git a/freetype/src/psaux/t1cmap.c b/freetype/src/psaux/t1cmap.c index 63d3e979f..c92a280dc 100644 --- a/freetype/src/psaux/t1cmap.c +++ b/freetype/src/psaux/t1cmap.c @@ -120,8 +120,12 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_standard_init( T1_CMapStd cmap ) + t1_cmap_standard_init( T1_CMapStd cmap, + FT_Pointer pointer ) { + FT_UNUSED( pointer ); + + t1_cmap_std_init( cmap, 0 ); return 0; } @@ -142,8 +146,12 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_expert_init( T1_CMapStd cmap ) + t1_cmap_expert_init( T1_CMapStd cmap, + FT_Pointer pointer ) { + FT_UNUSED( pointer ); + + t1_cmap_std_init( cmap, 1 ); return 0; } @@ -172,11 +180,14 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_custom_init( T1_CMapCustom cmap ) + t1_cmap_custom_init( T1_CMapCustom cmap, + FT_Pointer pointer ) { T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); T1_Encoding encoding = &face->type1.encoding; + FT_UNUSED( pointer ); + cmap->first = encoding->code_first; cmap->count = (FT_UInt)( encoding->code_last - cmap->first ); @@ -272,12 +283,15 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_unicode_init( PS_Unicodes unicodes ) + t1_cmap_unicode_init( PS_Unicodes unicodes, + FT_Pointer pointer ) { T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); FT_Memory memory = FT_FACE_MEMORY( face ); FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + FT_UNUSED( pointer ); + return psnames->unicodes_init( memory, unicodes, diff --git a/freetype/src/psaux/t1decode.c b/freetype/src/psaux/t1decode.c index 61746ae11..d21565b9d 100644 --- a/freetype/src/psaux/t1decode.c +++ b/freetype/src/psaux/t1decode.c @@ -4,7 +4,7 @@ /* */ /* PostScript Type 1 decoding routines (body). */ /* */ -/* Copyright 2000-2013 by */ +/* Copyright 2000-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1098,10 +1098,12 @@ goto Syntax_Error; /* apply hints to the loaded glyph outline now */ - hinter->apply( hinter->hints, - builder->current, - (PSH_Globals)builder->hints_globals, - decoder->hint_mode ); + error = hinter->apply( hinter->hints, + builder->current, + (PSH_Globals)builder->hints_globals, + decoder->hint_mode ); + if ( error ) + goto Fail; } /* add current outline to the glyph slot */ -- cgit v1.2.3