From 9cd403bc9f670603f5f0ce171fc8d470ec78e7be Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Sat, 11 Nov 2023 10:18:53 -0500 Subject: [PATCH] * src/raster/ftraster.c (Line_Up, Bezier_Up): Check "between" earlier. --- src/raster/ftraster.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index dd3858aea..de1c35f5e 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -942,6 +942,9 @@ e2 = y2 > maxy ? maxy : FLOOR( y2 ); e = y1 < miny ? miny : CEILING( y1 ); + if ( e2 < e ) /* between scanlines */ + goto Fin; + if ( ras.fresh ) { ras.cProfile->start = (Int)TRUNC( e ); @@ -953,9 +956,6 @@ ras.joint = (Bool)( y2 == e2 ); - if ( e2 < e ) - goto Fin; - size = (Int)TRUNC( e2 - e ) + 1; if ( top + size >= ras.maxBuff ) @@ -1105,8 +1105,6 @@ Long y1, y2, e, e2, dy; Long dx, x2; - TPoint* start_arc; - PLong top; @@ -1120,6 +1118,9 @@ e2 = y2 > maxy ? maxy : FLOOR( y2 ); e = y1 < miny ? miny : CEILING( y1 ); + if ( e2 < e ) /* between scanlines */ + goto Fin; + if ( ras.fresh ) { ras.cProfile->start = (Int)TRUNC( e ); @@ -1137,18 +1138,13 @@ ras.joint = (Bool)( y2 == e2 ); - if ( e2 < e ) - goto Fin; - if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff ) { ras.error = FT_THROW( Raster_Overflow ); return FAILURE; } - start_arc = arc; - - do + while ( e <= e2 ) { y2 = arc[0].y; x2 = arc[0].x; @@ -1183,7 +1179,6 @@ arc -= degree; } } - while ( e <= e2 ); Fin: ras.top = top;