aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/cff/cf2hints.c
diff options
context:
space:
mode:
authorMike DePaulo <mikedep333@gmail.com>2015-02-28 07:31:25 -0500
committerMike DePaulo <mikedep333@gmail.com>2015-02-28 18:11:34 -0500
commit360fe27b55c93c9c6c86895dbbf5db3efc66cc43 (patch)
tree01d8b3510d6a36ceba211168268d09658a8aa68b /freetype/src/cff/cf2hints.c
parenta769ab7159f0718e189f1aaa8b6a5a046c66c52c (diff)
downloadvcxsrv-360fe27b55c93c9c6c86895dbbf5db3efc66cc43.tar.gz
vcxsrv-360fe27b55c93c9c6c86895dbbf5db3efc66cc43.tar.bz2
vcxsrv-360fe27b55c93c9c6c86895dbbf5db3efc66cc43.zip
Updated to freetype 2.5.5
Conflicts: freetype/src/base/ftbdf.c freetype/src/base/fttype1.c freetype/src/pfr/pfrobjs.c
Diffstat (limited to 'freetype/src/cff/cf2hints.c')
-rw-r--r--freetype/src/cff/cf2hints.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/freetype/src/cff/cf2hints.c b/freetype/src/cff/cf2hints.c
index 5853d7758..040d193f3 100644
--- a/freetype/src/cff/cf2hints.c
+++ b/freetype/src/cff/cf2hints.c
@@ -304,9 +304,6 @@
cf2_hintmap_map( CF2_HintMap hintmap,
CF2_Fixed csCoord )
{
- FT_ASSERT( hintmap->isValid ); /* must call Build before Map */
- FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES );
-
if ( hintmap->count == 0 || ! hintmap->hinted )
{
/* there are no hints; use uniform scale and zero offset */
@@ -317,6 +314,7 @@
/* start linear search from last hit */
CF2_UInt i = hintmap->lastIndex;
+ FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES );
/* search up */
while ( i < hintmap->count - 1 &&
@@ -794,9 +792,12 @@
maskPtr = cf2_hintmask_getMaskPtr( &tempHintMask );
/* use the hStem hints only, which are first in the mask */
- /* TODO: compare this to cffhintmaskGetBitCount */
bitCount = cf2_arrstack_size( hStemHintArray );
+ /* Defense-in-depth. Should never return here. */
+ if ( bitCount > hintMask->bitCount )
+ return;
+
/* synthetic embox hints get highest priority */
if ( font->blues.doEmBoxHints )
{
@@ -1560,7 +1561,7 @@
{
/* -y */
*x = -glyphpath->xOffset;
- *y = glyphpath->xOffset;
+ *y = glyphpath->yOffset;
}
else
{
@@ -1691,7 +1692,8 @@
if ( glyphpath->elemIsQueued )
{
- FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) );
+ FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ||
+ glyphpath->hintMap.count == 0 );
cf2_glyphpath_pushPrevElem( glyphpath,
&glyphpath->hintMap,
@@ -1777,7 +1779,8 @@
if ( glyphpath->elemIsQueued )
{
- FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) );
+ FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ||
+ glyphpath->hintMap.count == 0 );
cf2_glyphpath_pushPrevElem( glyphpath,
&glyphpath->hintMap,