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.
This commit is contained in:
Ken Sharp 2010-04-05 11:19:38 +02:00 committed by Werner Lemberg
parent 460d23f168
commit 7baeeafcec
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2010-04-05 Ken Sharp <ken.sharp@artifex.com>
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 <wl@gnu.org> 2010-04-05 Werner Lemberg <wl@gnu.org>
Add new function `FT_Library_SetLcdFilterWeights'. Add new function `FT_Library_SetLcdFilterWeights'.

View File

@ -1122,13 +1122,13 @@
if ( Dx > 0 ) if ( Dx > 0 )
{ {
Ix = ( ras.precision * Dx ) / Dy; Ix = SMulDiv( ras.precision, Dx, Dy);
Rx = ( ras.precision * Dx ) % Dy; Rx = ( ras.precision * Dx ) % Dy;
Dx = 1; Dx = 1;
} }
else else
{ {
Ix = -( ( ras.precision * -Dx ) / Dy ); Ix = SMulDiv( ras.precision, -Dx, Dy) * -1;
Rx = ( ras.precision * -Dx ) % Dy; Rx = ( ras.precision * -Dx ) % Dy;
Dx = -1; Dx = -1;
} }