Commit d77e72295e2f0494bd993c4f59b642c6bd5c3192

Werner Lemberg 2008-06-05T22:07:19

* src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0' correctly. This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.

diff --git a/ChangeLog b/ChangeLog
index 2bbc350..cc9ffda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-06  Werner Lemberg  <wl@gnu.org>
+
+	* src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0'
+	correctly.  This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.
+
 2008-06-03  Werner Lemberg  <wl@gnu.org>
 
 	* include/freetype/ftcache.h (FTC_FaceID): Change type back to
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index da2c883..f0f91e9 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -6232,9 +6232,13 @@
         org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );
 
       cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base );
-      new_dist = ( old_range != 0 )
-                   ? TT_MULDIV( org_dist, cur_range, old_range )
-                   : cur_dist;
+
+      if ( org_dist )
+        new_dist = ( old_range != 0 )
+                     ? TT_MULDIV( org_dist, cur_range, old_range )
+                     : cur_dist;
+      else
+        new_dist = 0;
 
       CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );
     }