[raster] Fix valgrind warning. * src/raster/ftraster.c (Decompose_Curve) <default>: Access point[0] only if we don't hit `limit'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/ChangeLog b/ChangeLog
index 73e558f..898ac3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-06 Yuriy Kaminskiy <yumkam@mail.ru>
+
+ [raster] Fix valgrind warning.
+
+ * src/raster/ftraster.c (Decompose_Curve) <default>: Access point[0]
+ only if we don't hit `limit'.
+
2010-08-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Fix Savannah bug #30658.
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index ff3e12c..ce6fdfe 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -1931,18 +1931,21 @@
y1 = SCALED( point[-2].y );
x2 = SCALED( point[-1].x );
y2 = SCALED( point[-1].y );
- x3 = SCALED( point[ 0].x );
- y3 = SCALED( point[ 0].y );
if ( flipped )
{
SWAP_( x1, y1 );
SWAP_( x2, y2 );
- SWAP_( x3, y3 );
}
if ( point <= limit )
{
+ x3 = SCALED( point[0].x );
+ y3 = SCALED( point[0].y );
+
+ if ( flipped )
+ SWAP_( x3, y3 );
+
if ( Cubic_To( RAS_VARS x1, y1, x2, y2, x3, y3 ) )
goto Fail;
continue;
@@ -2495,7 +2498,7 @@
PByte p;
- p = bits - e1*ras.target.pitch;
+ p = bits - e1 * ras.target.pitch;
if ( ras.target.pitch > 0 )
p += ( ras.target.rows - 1 ) * ras.target.pitch;