diff options
Diffstat (limited to 'src/3rdparty/freetype/src/otvalid')
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/Jamfile | 37 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/module.mk | 2 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvalid.c | 3 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvalid.h | 11 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvbase.c | 2 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvcommn.c | 5 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvcommn.h | 43 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otverror.h | 6 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvgdef.c | 2 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvgpos.c | 2 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvgpos.h | 2 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvgsub.c | 22 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvjstf.c | 2 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvmath.c | 4 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvmod.c | 17 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/otvmod.h | 5 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/otvalid/rules.mk | 2 |
17 files changed, 70 insertions, 97 deletions
diff --git a/src/3rdparty/freetype/src/otvalid/Jamfile b/src/3rdparty/freetype/src/otvalid/Jamfile deleted file mode 100644 index 36db0e1f83..0000000000 --- a/src/3rdparty/freetype/src/otvalid/Jamfile +++ /dev/null @@ -1,37 +0,0 @@ -# FreeType 2 src/otvalid Jamfile -# -# Copyright (C) 2004-2019 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - -SubDir FT2_TOP $(FT2_SRC_DIR) otvalid ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = otvbase - otvcommn - otvgdef - otvgpos - otvgsub - otvjstf - otvmath - otvmod - ; - } - else - { - _sources = otvalid ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/otvalid Jamfile diff --git a/src/3rdparty/freetype/src/otvalid/module.mk b/src/3rdparty/freetype/src/otvalid/module.mk index 5ea5b7b57b..90138426e4 100644 --- a/src/3rdparty/freetype/src/otvalid/module.mk +++ b/src/3rdparty/freetype/src/otvalid/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2023 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/src/3rdparty/freetype/src/otvalid/otvalid.c b/src/3rdparty/freetype/src/otvalid/otvalid.c index e3964b99ae..3b1e23a6f7 100644 --- a/src/3rdparty/freetype/src/otvalid/otvalid.c +++ b/src/3rdparty/freetype/src/otvalid/otvalid.c @@ -4,7 +4,7 @@ * * FreeType validator for OpenType tables (body only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "otvbase.c" #include "otvcommn.c" diff --git a/src/3rdparty/freetype/src/otvalid/otvalid.h b/src/3rdparty/freetype/src/otvalid/otvalid.h index 5ca819f261..7edadb771b 100644 --- a/src/3rdparty/freetype/src/otvalid/otvalid.h +++ b/src/3rdparty/freetype/src/otvalid/otvalid.h @@ -4,7 +4,7 @@ * * OpenType table validation (specification only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -20,13 +20,12 @@ #define OTVALID_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> -#include "otverror.h" /* must come before FT_INTERNAL_VALIDATE_H */ +#include "otverror.h" /* must come before `ftvalid.h' */ -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftvalid.h> +#include <freetype/internal/ftstream.h> FT_BEGIN_HEADER diff --git a/src/3rdparty/freetype/src/otvalid/otvbase.c b/src/3rdparty/freetype/src/otvalid/otvbase.c index be69d7ca31..f449795f89 100644 --- a/src/3rdparty/freetype/src/otvalid/otvbase.c +++ b/src/3rdparty/freetype/src/otvalid/otvbase.c @@ -4,7 +4,7 @@ * * OpenType BASE table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/src/3rdparty/freetype/src/otvalid/otvcommn.c b/src/3rdparty/freetype/src/otvalid/otvcommn.c index 5ed1723506..b94d8a0651 100644 --- a/src/3rdparty/freetype/src/otvalid/otvcommn.c +++ b/src/3rdparty/freetype/src/otvalid/otvcommn.c @@ -4,7 +4,7 @@ * * OpenType common tables validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -151,6 +151,9 @@ FT_UInt result = 0; + if ( !count ) + return result; + switch ( CoverageFormat ) { case 1: diff --git a/src/3rdparty/freetype/src/otvalid/otvcommn.h b/src/3rdparty/freetype/src/otvalid/otvcommn.h index bfcc5b974a..6702c00085 100644 --- a/src/3rdparty/freetype/src/otvalid/otvcommn.h +++ b/src/3rdparty/freetype/src/otvalid/otvcommn.h @@ -4,7 +4,7 @@ * * OpenType common tables validation (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -20,9 +20,8 @@ #define OTVCOMMN_H_ -#include <ft2build.h> #include "otvalid.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> FT_BEGIN_HEADER @@ -106,10 +105,11 @@ FT_BEGIN_HEADER FT_Byte* pp = (FT_Byte*)_size ## _p; \ \ \ - FT_TRACE3(( "\n" \ - "Invalid offset to optional table `%s'" \ - " set to zero.\n" \ - "\n", #_size )); \ + FT_TRACE3(( "\n" )); \ + FT_TRACE3(( "Invalid offset to optional table `%s'" \ + " set to zero.\n", \ + #_size )); \ + FT_TRACE3(( "\n" )); \ \ _size = pp[0] = pp[1] = 0; \ } \ @@ -128,10 +128,11 @@ FT_BEGIN_HEADER FT_Byte* pp = (FT_Byte*)_size ## _p; \ \ \ - FT_TRACE3(( "\n" \ - "Invalid offset to optional table `%s'" \ - " set to zero.\n" \ - "\n", #_size )); \ + FT_TRACE3(( "\n" )); \ + FT_TRACE3(( "Invalid offset to optional table `%s'" \ + " set to zero.\n", \ + #_size )); \ + FT_TRACE3(( "\n" )); \ \ _size = pp[0] = pp[1] = pp[2] = pp[3] = 0; \ } \ @@ -179,24 +180,24 @@ FT_BEGIN_HEADER #define OTV_ENTER \ FT_BEGIN_STMNT \ otvalid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \ + FT_TRACE4(( "%*.s", otvalid->debug_indent, "" )); \ FT_TRACE4(( "%s table\n", \ otvalid->debug_function_name[otvalid->nesting_level] )); \ FT_END_STMNT -#define OTV_NAME_ENTER( name ) \ - FT_BEGIN_STMNT \ - otvalid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \ - FT_TRACE4(( "%s table\n", name )); \ +#define OTV_NAME_ENTER( name ) \ + FT_BEGIN_STMNT \ + otvalid->debug_indent += 2; \ + FT_TRACE4(( "%*.s", otvalid->debug_indent, "" )); \ + FT_TRACE4(( "%s table\n", name )); \ FT_END_STMNT #define OTV_EXIT otvalid->debug_indent -= 2 -#define OTV_TRACE( s ) \ - FT_BEGIN_STMNT \ - FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \ - FT_TRACE4( s ); \ +#define OTV_TRACE( s ) \ + FT_BEGIN_STMNT \ + FT_TRACE4(( "%*.s", otvalid->debug_indent, "" )); \ + FT_TRACE4( s ); \ FT_END_STMNT #else /* !FT_DEBUG_LEVEL_TRACE */ diff --git a/src/3rdparty/freetype/src/otvalid/otverror.h b/src/3rdparty/freetype/src/otvalid/otverror.h index a7d35acf1a..4c4049ca5b 100644 --- a/src/3rdparty/freetype/src/otvalid/otverror.h +++ b/src/3rdparty/freetype/src/otvalid/otverror.h @@ -4,7 +4,7 @@ * * OpenType validation module error codes (specification only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -26,7 +26,7 @@ #ifndef OTVERROR_H_ #define OTVERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX OTV_Err_ #define FT_ERR_BASE FT_Mod_Err_OTvalid -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* OTVERROR_H_ */ diff --git a/src/3rdparty/freetype/src/otvalid/otvgdef.c b/src/3rdparty/freetype/src/otvalid/otvgdef.c index 2529b544d2..d62e8187f6 100644 --- a/src/3rdparty/freetype/src/otvalid/otvgdef.c +++ b/src/3rdparty/freetype/src/otvalid/otvgdef.c @@ -4,7 +4,7 @@ * * OpenType GDEF table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/src/3rdparty/freetype/src/otvalid/otvgpos.c b/src/3rdparty/freetype/src/otvalid/otvgpos.c index f3bddeac6c..f6102afbce 100644 --- a/src/3rdparty/freetype/src/otvalid/otvgpos.c +++ b/src/3rdparty/freetype/src/otvalid/otvgpos.c @@ -4,7 +4,7 @@ * * OpenType GPOS table validation (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/src/3rdparty/freetype/src/otvalid/otvgpos.h b/src/3rdparty/freetype/src/otvalid/otvgpos.h index b3154312eb..b5d0f54850 100644 --- a/src/3rdparty/freetype/src/otvalid/otvgpos.h +++ b/src/3rdparty/freetype/src/otvalid/otvgpos.h @@ -4,7 +4,7 @@ * * OpenType GPOS table validator (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/src/3rdparty/freetype/src/otvalid/otvgsub.c b/src/3rdparty/freetype/src/otvalid/otvgsub.c index 97da997d3d..5d40d9243d 100644 --- a/src/3rdparty/freetype/src/otvalid/otvgsub.c +++ b/src/3rdparty/freetype/src/otvalid/otvgsub.c @@ -4,7 +4,7 @@ * * OpenType GSUB table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -61,7 +61,8 @@ { FT_Bytes Coverage; FT_Int DeltaGlyphID; - FT_Long idx; + FT_UInt first_cov, last_cov; + FT_UInt first_idx, last_idx; OTV_LIMIT_CHECK( 4 ); @@ -70,12 +71,21 @@ otv_Coverage_validate( Coverage, otvalid, -1 ); - idx = (FT_Long)otv_Coverage_get_first( Coverage ) + DeltaGlyphID; - if ( idx < 0 ) + first_cov = otv_Coverage_get_first( Coverage ); + last_cov = otv_Coverage_get_last( Coverage ); + + /* These additions are modulo 65536. */ + first_idx = (FT_UInt)( (FT_Int)first_cov + DeltaGlyphID ) & 0xFFFFU; + last_idx = (FT_UInt)( (FT_Int)last_cov + DeltaGlyphID ) & 0xFFFFU; + + /* Since the maximum number of glyphs is 2^16 - 1 = 65535, */ + /* the largest possible glyph index is 65534. For this */ + /* reason there can't be a wrap-around region, which would */ + /* imply the use of the invalid glyph index 65535. */ + if ( first_idx > last_idx ) FT_INVALID_DATA; - idx = (FT_Long)otv_Coverage_get_last( Coverage ) + DeltaGlyphID; - if ( (FT_UInt)idx >= otvalid->glyph_count ) + if ( last_idx >= otvalid->glyph_count ) FT_INVALID_DATA; } break; diff --git a/src/3rdparty/freetype/src/otvalid/otvjstf.c b/src/3rdparty/freetype/src/otvalid/otvjstf.c index d4e6d87178..712039c661 100644 --- a/src/3rdparty/freetype/src/otvalid/otvjstf.c +++ b/src/3rdparty/freetype/src/otvalid/otvjstf.c @@ -4,7 +4,7 @@ * * OpenType JSTF table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/src/3rdparty/freetype/src/otvalid/otvmath.c b/src/3rdparty/freetype/src/otvalid/otvmath.c index 3aaf0ec0ec..01fd863c97 100644 --- a/src/3rdparty/freetype/src/otvalid/otvmath.c +++ b/src/3rdparty/freetype/src/otvalid/otvmath.c @@ -4,7 +4,7 @@ * * OpenType MATH table validation (body). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by George Williams. @@ -141,7 +141,7 @@ OTV_OPTIONAL_TABLE( DeviceTableOffset ); - /* OTV_NAME_ENTER( "MathKern" );*/ + /* OTV_NAME_ENTER( "MathKern" ); */ OTV_LIMIT_CHECK( 2 ); diff --git a/src/3rdparty/freetype/src/otvalid/otvmod.c b/src/3rdparty/freetype/src/otvalid/otvmod.c index f417bd220f..d6057c5a47 100644 --- a/src/3rdparty/freetype/src/otvalid/otvmod.c +++ b/src/3rdparty/freetype/src/otvalid/otvmod.c @@ -4,7 +4,7 @@ * * FreeType's OpenType validation module implementation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_TRUETYPE_TABLES_H -#include FT_TRUETYPE_TAGS_H -#include FT_OPENTYPE_VALIDATE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_OPENTYPE_VALIDATE_H +#include <freetype/tttables.h> +#include <freetype/tttags.h> +#include <freetype/ftotval.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svotval.h> #include "otvmod.h" #include "otvalid.h" @@ -54,7 +53,7 @@ if ( error ) goto Exit; - if ( FT_ALLOC( *table, *table_len ) ) + if ( FT_QALLOC( *table, *table_len ) ) goto Exit; error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len ); @@ -95,7 +94,7 @@ */ if ( face->num_glyphs > 0xFFFFL ) { - FT_TRACE1(( "otv_validate: Invalid glyphs index (0x0000FFFF - 0x%08x) ", + FT_TRACE1(( "otv_validate: Invalid glyphs index (0x0000FFFF - 0x%08lx) ", face->num_glyphs )); FT_TRACE1(( "are not handled by OpenType tables\n" )); num_glyphs = 0xFFFF; diff --git a/src/3rdparty/freetype/src/otvalid/otvmod.h b/src/3rdparty/freetype/src/otvalid/otvmod.h index 5539de7ec6..f0e68dbc08 100644 --- a/src/3rdparty/freetype/src/otvalid/otvmod.h +++ b/src/3rdparty/freetype/src/otvalid/otvmod.h @@ -5,7 +5,7 @@ * FreeType's OpenType validation module implementation * (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2023 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -21,8 +21,7 @@ #define OTVMOD_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/src/3rdparty/freetype/src/otvalid/rules.mk b/src/3rdparty/freetype/src/otvalid/rules.mk index 3c6ece1c19..800cb87331 100644 --- a/src/3rdparty/freetype/src/otvalid/rules.mk +++ b/src/3rdparty/freetype/src/otvalid/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2023 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, |