summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/otvalid
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2013-03-26 08:57:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-01 12:03:55 +0200
commit6845a4fb0147117e8517d66f18792ca7acdbe06e (patch)
tree68e35417b79989a7af8a4ea8c0d282b84dbe0a6e /src/3rdparty/freetype/src/otvalid
parent0fcadcca3d0842354de07ffaa8c622e607aab22c (diff)
Update bundled FreeType sources to 2.3.12
Most important changes: * SFNT cmap 13 table format support; * fixed glitches when rasterizing stretched TTF (xsize!=ysize); * various fixes in Type1, CFF, and PCF drivers Change-Id: Ib9e2210ffbd0daa2fdbf518ea87f4be502de6b48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/otvalid')
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvcommn.h44
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvgpos.c5
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvgsub.c3
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvmod.c23
-rw-r--r--src/3rdparty/freetype/src/otvalid/otvmod.h4
5 files changed, 49 insertions, 30 deletions
diff --git a/src/3rdparty/freetype/src/otvalid/otvcommn.h b/src/3rdparty/freetype/src/otvalid/otvcommn.h
index 71726d5b2e..898887fc95 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 2004, 2005, 2007 by */
+/* Copyright 2004, 2005, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -85,27 +85,27 @@ FT_BEGIN_HEADER
FT_INVALID_TOO_SHORT; \
FT_END_STMNT
-#define OTV_SIZE_CHECK( _size ) \
- FT_BEGIN_STMNT \
- if ( _size > 0 && _size < table_size ) \
- { \
- if ( valid->root->level == FT_VALIDATE_PARANOID ) \
- FT_INVALID_OFFSET; \
- else \
- { \
- /* strip off `const' */ \
- FT_Byte* pp = (FT_Byte*)_size ## _p; \
- \
- \
- FT_TRACE3(( "\n" \
- "Invalid offset to optional table `%s'!\n" \
- "Set to zero.\n" \
- "\n", #_size )); \
- \
- /* always assume 16bit entities */ \
- _size = pp[0] = pp[1] = 0; \
- } \
- } \
+#define OTV_SIZE_CHECK( _size ) \
+ FT_BEGIN_STMNT \
+ if ( _size > 0 && _size < table_size ) \
+ { \
+ if ( valid->root->level == FT_VALIDATE_PARANOID ) \
+ FT_INVALID_OFFSET; \
+ else \
+ { \
+ /* strip off `const' */ \
+ FT_Byte* pp = (FT_Byte*)_size ## _p; \
+ \
+ \
+ FT_TRACE3(( "\n" \
+ "Invalid offset to optional table `%s'" \
+ " set to zero.\n" \
+ "\n", #_size )); \
+ \
+ /* always assume 16bit entities */ \
+ _size = pp[0] = pp[1] = 0; \
+ } \
+ } \
FT_END_STMNT
diff --git a/src/3rdparty/freetype/src/otvalid/otvgpos.c b/src/3rdparty/freetype/src/otvalid/otvgpos.c
index 53025ec5e6..49b46183a3 100644
--- a/src/3rdparty/freetype/src/otvalid/otvgpos.c
+++ b/src/3rdparty/freetype/src/otvalid/otvgpos.c
@@ -209,7 +209,7 @@
{
if ( format & 1 )
{
- FT_UInt table_size;
+ FT_PtrDist table_size;
OTV_OPTIONAL_TABLE( device );
@@ -911,7 +911,8 @@
{
case 1: /* ExtensionPosFormat1 */
{
- FT_UInt ExtensionLookupType, ExtensionOffset;
+ FT_UInt ExtensionLookupType;
+ FT_ULong ExtensionOffset;
OTV_Validate_Func validate;
diff --git a/src/3rdparty/freetype/src/otvalid/otvgsub.c b/src/3rdparty/freetype/src/otvalid/otvgsub.c
index f01fca1e89..ed499d1e92 100644
--- a/src/3rdparty/freetype/src/otvalid/otvgsub.c
+++ b/src/3rdparty/freetype/src/otvalid/otvgsub.c
@@ -415,7 +415,8 @@
{
case 1: /* ExtensionSubstFormat1 */
{
- FT_UInt ExtensionLookupType, ExtensionOffset;
+ FT_UInt ExtensionLookupType;
+ FT_ULong ExtensionOffset;
OTV_Validate_Func validate;
diff --git a/src/3rdparty/freetype/src/otvalid/otvmod.c b/src/3rdparty/freetype/src/otvalid/otvmod.c
index 63c25f690c..3248564560 100644
--- a/src/3rdparty/freetype/src/otvalid/otvmod.c
+++ b/src/3rdparty/freetype/src/otvalid/otvmod.c
@@ -82,12 +82,25 @@
FT_Byte* volatile math;
FT_ULong len_base, len_gdef, len_gpos, len_gsub, len_jstf;
FT_ULong len_math;
+ FT_UInt num_glyphs = (FT_UInt)face->num_glyphs;
FT_ValidatorRec volatile valid;
base = gdef = gpos = gsub = jstf = math = NULL;
len_base = len_gdef = len_gpos = len_gsub = len_jstf = len_math = 0;
+ /*
+ * XXX: OpenType tables cannot handle 32-bit glyph index,
+ * although broken TrueType can have 32-bit glyph index.
+ */
+ if ( face->num_glyphs > 0xFFFFL )
+ {
+ FT_TRACE1(( "otv_validate: Invalid glyphs index (0x0000FFFF - 0x%08x) ",
+ face->num_glyphs ));
+ FT_TRACE1(( "are not handled by OpenType tables\n" ));
+ num_glyphs = 0xFFFF;
+ }
+
/* load tables */
if ( ot_flags & FT_VALIDATE_BASE )
@@ -148,7 +161,7 @@
{
ft_validator_init( &valid, gpos, gpos + len_gpos, FT_VALIDATE_DEFAULT );
if ( ft_setjmp( valid.jump_buffer ) == 0 )
- otv_GPOS_validate( gpos, face->num_glyphs, &valid );
+ otv_GPOS_validate( gpos, num_glyphs, &valid );
error = valid.error;
if ( error )
goto Exit;
@@ -158,7 +171,7 @@
{
ft_validator_init( &valid, gsub, gsub + len_gsub, FT_VALIDATE_DEFAULT );
if ( ft_setjmp( valid.jump_buffer ) == 0 )
- otv_GSUB_validate( gsub, face->num_glyphs, &valid );
+ otv_GSUB_validate( gsub, num_glyphs, &valid );
error = valid.error;
if ( error )
goto Exit;
@@ -168,7 +181,7 @@
{
ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT );
if ( ft_setjmp( valid.jump_buffer ) == 0 )
- otv_GDEF_validate( gdef, gsub, gpos, face->num_glyphs, &valid );
+ otv_GDEF_validate( gdef, gsub, gpos, num_glyphs, &valid );
error = valid.error;
if ( error )
goto Exit;
@@ -178,7 +191,7 @@
{
ft_validator_init( &valid, jstf, jstf + len_jstf, FT_VALIDATE_DEFAULT );
if ( ft_setjmp( valid.jump_buffer ) == 0 )
- otv_JSTF_validate( jstf, gsub, gpos, face->num_glyphs, &valid );
+ otv_JSTF_validate( jstf, gsub, gpos, num_glyphs, &valid );
error = valid.error;
if ( error )
goto Exit;
@@ -188,7 +201,7 @@
{
ft_validator_init( &valid, math, math + len_math, FT_VALIDATE_DEFAULT );
if ( ft_setjmp( valid.jump_buffer ) == 0 )
- otv_MATH_validate( math, face->num_glyphs, &valid );
+ otv_MATH_validate( math, num_glyphs, &valid );
error = valid.error;
if ( error )
goto Exit;
diff --git a/src/3rdparty/freetype/src/otvalid/otvmod.h b/src/3rdparty/freetype/src/otvalid/otvmod.h
index 1bfc1899fe..573b2a0c4b 100644
--- a/src/3rdparty/freetype/src/otvalid/otvmod.h
+++ b/src/3rdparty/freetype/src/otvalid/otvmod.h
@@ -27,6 +27,10 @@
FT_BEGIN_HEADER
+#ifdef FT_CONFIG_OPTION_PIC
+#error "this module does not support PIC yet"
+#endif
+
FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class;