Commit f89396cb6284954ff98b5dcbfc38e144deccdc83

Dave Arnold 2014-12-04T06:17:26

[cff] Modify an FT_ASSERT. * src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah bug #43661, the test font `...aspartam.otf' still triggers an FT_ASSERT. Since hintmap still works with count==0, ... (cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to suppress the assert.

diff --git a/ChangeLog b/ChangeLog
index 6a25737..3940e21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2014-12-04  Dave Arnold  <darnold@adobe.com>
 
+	[cff] Modify an FT_ASSERT.
+
+	* src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah
+	bug #43661, the test font `...aspartam.otf' still triggers an
+	FT_ASSERT.  Since hintmap still works with count==0, ...
+	(cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to
+	suppress the assert.
+
+2014-12-04  Dave Arnold  <darnold@adobe.com>
+
 	[cff] Fix Savannah bug #43661.
 
 	* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
diff --git a/src/cff/cf2hints.c b/src/cff/cf2hints.c
index 28a892b..040d193 100644
--- a/src/cff/cf2hints.c
+++ b/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                  &&
@@ -1694,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,
@@ -1780,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,