From 7baeeafcec7fd2267191937e14c1f753424beb89 Mon Sep 17 00:00:00 2001 From: Ken Sharp Date: Mon, 5 Apr 2010 11:19:38 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ src/raster/ftraster.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8fa18f81..c22e570f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-04-05 Ken Sharp + + 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 Add new function `FT_Library_SetLcdFilterWeights'. diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index 86d11d8da..cdde4715a 100644 --- 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; }