[raster] Adjust sub-band bisecting limits. We can bisect a band until it is just a single scan line. This might be slow and cause time-outs but if we need to impose limits it should be elsewhere. * src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding.
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 54 55 56 57
diff --git a/ChangeLog b/ChangeLog
index cc5c1f9..fc6d8b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2021-06-25 Alexei Podtelezhnikov <apodtele@gmail.com>
+ [raster] Adjust sub-band bisecting limits.
+
+ We can bisect a band until it is just a single scan line. This might
+ be slow and cause time-outs but if we need to impose limits it should
+ be elsewhere.
+
+ * src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding.
+
+2021-06-25 Alexei Podtelezhnikov <apodtele@gmail.com>
+
* src/raster/ftraster.c (Render_Single_Pass): Remove dead code.
2021-06-25 Werner Lemberg <wl@gnu.org>
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index a1cbf62..b88a436 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -528,6 +528,7 @@
TPoint arcs[3 * MaxBezier + 1]; /* The Bezier stack */
black_TBand band_stack[16]; /* band stack used for sub-banding */
+ /* enough for signed short bands */
Int band_top; /* band stack top */
};
@@ -3054,19 +3055,19 @@
i = ras.band_stack[ras.band_top].y_min;
j = ras.band_stack[ras.band_top].y_max;
- k = (Short)( ( i + j ) / 2 );
-
- if ( ras.band_top >= 7 || k < i )
+ if ( i == j )
{
ras.band_top = 0;
return ras.error; /* still Raster_Overflow */
}
- ras.band_stack[ras.band_top + 1].y_min = k;
+ k = (Short)( ( i + j ) / 2 );
+
+ ras.band_stack[ras.band_top + 1].y_min = (Short)( k + 1 );
ras.band_stack[ras.band_top + 1].y_max = j;
- ras.band_stack[ras.band_top].y_max = (Short)( k - 1 );
+ ras.band_stack[ras.band_top].y_max = k;
ras.band_top++;
}