summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/truetype/ttpload.c
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-04 20:18:14 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-04 20:18:14 +0100
commit4159ee840549df11287294f0928e90f35f3e06ff (patch)
tree4a3947e37d54bdb78b4042e9ced20dbf181b5a2c /src/3rdparty/freetype/src/truetype/ttpload.c
parent59dbf1786f22ec4ac88d8f9d38cac5cfb82acaea (diff)
parentc8c39ecc37c156ac2677de09a26548dfc274b564 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
Diffstat (limited to 'src/3rdparty/freetype/src/truetype/ttpload.c')
-rw-r--r--src/3rdparty/freetype/src/truetype/ttpload.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/3rdparty/freetype/src/truetype/ttpload.c b/src/3rdparty/freetype/src/truetype/ttpload.c
index 9991925425..4647c938ae 100644
--- a/src/3rdparty/freetype/src/truetype/ttpload.c
+++ b/src/3rdparty/freetype/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (body). */
/* */
-/* Copyright 1996-2002, 2004-2013 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -118,20 +118,20 @@
/* we only handle the case where `maxp' gives a larger value */
if ( face->num_locations <= (FT_ULong)face->root.num_glyphs )
{
- FT_Long new_loca_len =
- ( (FT_Long)( face->root.num_glyphs ) + 1 ) << shift;
+ FT_ULong new_loca_len =
+ ( (FT_ULong)face->root.num_glyphs + 1 ) << shift;
TT_Table entry = face->dir_tables;
TT_Table limit = entry + face->num_tables;
- FT_Long pos = FT_Stream_Pos( stream );
+ FT_Long pos = (FT_Long)FT_STREAM_POS();
FT_Long dist = 0x7FFFFFFFL;
/* compute the distance to next table in font file */
for ( ; entry < limit; entry++ )
{
- FT_Long diff = entry->Offset - pos;
+ FT_Long diff = (FT_Long)entry->Offset - pos;
if ( diff > 0 && diff < dist )
@@ -141,17 +141,25 @@
if ( entry == limit )
{
/* `loca' is the last table */
- dist = stream->size - pos;
+ dist = (FT_Long)stream->size - pos;
}
- if ( new_loca_len <= dist )
+ if ( new_loca_len <= (FT_ULong)dist )
{
- face->num_locations = face->root.num_glyphs + 1;
+ face->num_locations = (FT_ULong)face->root.num_glyphs + 1;
table_len = new_loca_len;
FT_TRACE2(( "adjusting num_locations to %d\n",
face->num_locations ));
}
+ else
+ {
+ face->root.num_glyphs = face->num_locations
+ ? (FT_Long)face->num_locations - 1 : 0;
+
+ FT_TRACE2(( "adjusting num_glyphs to %d\n",
+ face->root.num_glyphs ));
+ }
}
}