Index: third_party/freetype/src/psaux/psobjs.c |
diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/psaux/psobjs.c b/third_party/freetype/src/psaux/psobjs.c |
similarity index 98% |
rename from core/src/fxge/fx_freetype/fxft2.5.01/src/psaux/psobjs.c |
rename to third_party/freetype/src/psaux/psobjs.c |
index 2cd90039d0983304e2ca7838b5be7db302c504d7..7ec3b4cf5fd3a81164adcb57f2af75f30f3ebefc 100644 |
--- a/core/src/fxge/fx_freetype/fxft2.5.01/src/psaux/psobjs.c |
+++ b/third_party/freetype/src/psaux/psobjs.c |
@@ -4,7 +4,7 @@ |
/* */ |
/* Auxiliary functions for PostScript fonts (body). */ |
/* */ |
-/* Copyright 1996-2013 by */ |
+/* Copyright 1996-2014 by */ |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
/* */ |
/* This file is part of the FreeType project, and may only be used, */ |
@@ -16,10 +16,10 @@ |
/***************************************************************************/ |
-#include "../../include/ft2build.h" |
-#include "../../include/freetype/internal/psaux.h" |
-#include "../../include/freetype/internal/ftdebug.h" |
-#include "../../include/freetype/internal/ftcalc.h" |
+#include <ft2build.h> |
+#include FT_INTERNAL_POSTSCRIPT_AUX_H |
+#include FT_INTERNAL_DEBUG_H |
+#include FT_INTERNAL_CALC_H |
#include "psobjs.h" |
#include "psconv.h" |
@@ -847,6 +847,8 @@ |
/* first character must be a delimiter or a part of a number */ |
/* NB: `values' can be NULL if we just want to skip the */ |
/* array; in this case we ignore `max_values' */ |
+ /* */ |
+ /* return number of successfully parsed values */ |
static FT_Int |
ps_tofixedarray( FT_Byte* *acur, |
@@ -1110,8 +1112,7 @@ |
goto Store_Integer; |
case T1_FIELD_TYPE_INTEGER: |
- { FT_Bool ret = xyq_PS_Conv_ToInt( &cur, limit, &val ); /* XYQ 2007-10-10: abort if not a number*/ |
- if (!ret) break; } |
+ val = PS_Conv_ToInt( &cur, limit ); |
/* fall through */ |
Store_Integer: |
@@ -1194,15 +1195,14 @@ |
case T1_FIELD_TYPE_BBOX: |
{ |
- // Add by Johnson, fix a Error #1: UNINITIALIZED READ. #testdoc 1282.pdf |
- FT_Fixed temp[4] = {0,0,0,0}; |
+ FT_Fixed temp[4]; |
FT_BBox* bbox = (FT_BBox*)q; |
FT_Int result; |
result = ps_tofixedarray( &cur, limit, 4, temp, 0 ); |
- if ( result < 0 ) |
+ if ( result < 4 ) |
{ |
FT_ERROR(( "ps_parser_load_field:" |
" expected four integers in bounding box\n" )); |
@@ -1232,7 +1232,7 @@ |
{ |
result = ps_tofixedarray( &cur, limit, max_objects, |
temp + i * max_objects, 0 ); |
- if ( result < 0 ) |
+ if ( result < 0 || (FT_UInt)result < max_objects ) |
{ |
FT_ERROR(( "ps_parser_load_field:" |
" expected %d integers in the %s subarray\n" |
@@ -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; |
} |