Commit 00dfa3304e7275c1cba822ebd9e760b63d4601fd

Werner Lemberg 2013-02-05T19:23:16

[truetype] A better fix for Savannah bug #38211. * src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock).

diff --git a/ChangeLog b/ChangeLog
index 7bd42e5..9e7b6bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-02-05  Werner Lemberg  <wl@gnu.org>
+
+	[truetype] A better fix for Savannah bug #38211.
+
+	* src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to
+	MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock).
+
 2013-02-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[pcf] Streamline parsing of PCF encoding table.
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 4e4a5bf..39b804c 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -6979,11 +6979,17 @@
           new_dist = FT_MulDiv( org_dist, cur_range, old_range );
         else
         {
-          /* use the middle position */
-          new_dist = cur_dist -
-                     CUR_fast_dualproj( &CUR.zp2.cur[point] ) +
-                     ( CUR_fast_dualproj( &CUR.zp1.cur[CUR.GS.rp1] ) +
-                       CUR_fast_dualproj( &CUR.zp1.cur[CUR.GS.rp2] ) ) / 2;
+          /* This is the same as what MS does for the invalid case:  */
+          /*                                                         */
+          /*   delta = (Original_Pt - Original_RP1) -                */
+          /*           (Current_Pt - Current_RP1)                    */
+          /*                                                         */
+          /* In FreeType speak:                                      */
+          /*                                                         */
+          /*   new_dist = cur_dist -                                 */
+          /*              org_dist - cur_dist;                       */
+
+          new_dist = -org_dist;
         }
       }
       else