aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/psaux
diff options
context:
space:
mode:
Diffstat (limited to 'freetype/src/psaux')
-rw-r--r--freetype/src/psaux/psconv.c9
-rw-r--r--freetype/src/psaux/psobjs.c10
-rw-r--r--freetype/src/psaux/t1cmap.c22
-rw-r--r--freetype/src/psaux/t1decode.c12
4 files changed, 39 insertions, 14 deletions
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 */