ref: 7baeeafcec7fd2267191937e14c1f753424beb89
parent: 460d23f1689f14f5812bfe4b322fd3f2a449905e
author: Ken Sharp <[email protected]>
date: Mon Apr 5 07:19:38 EDT 2010
Fix Savannah bug #29335. * src/raster/ftraster.c (Line_Up): Use slow multiplication to prevent overflow. This shouldn't have any serious impact on speed, however.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-04-05 Ken Sharp <[email protected]>
+
+ Fix Savannah bug #29335.
+
+ * src/raster/ftraster.c (Line_Up): Use slow multiplication to
+ prevent overflow. This shouldn't have any serious impact on speed,
+ however.
+
2010-04-05 Werner Lemberg <[email protected]>
Add new function `FT_Library_SetLcdFilterWeights'.
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -1122,13 +1122,13 @@
if ( Dx > 0 )
{
- Ix = ( ras.precision * Dx ) / Dy;
+ Ix = SMulDiv( ras.precision, Dx, Dy);
Rx = ( ras.precision * Dx ) % Dy;
Dx = 1;
}
else
{
- Ix = -( ( ras.precision * -Dx ) / Dy );
+ Ix = SMulDiv( ras.precision, -Dx, Dy) * -1;
Rx = ( ras.precision * -Dx ) % Dy;
Dx = -1;
}