static PrimitiveInfo *TraceStrokePolygon(const Image *image,
const DrawInfo *draw_info,const PrimitiveInfo *primitive_info)
{
-#define CheckPathExtent(extent) \
- if (q >= (ssize_t) (max_strokes-(extent)-6*BezierQuantum-360)) \
+#define CheckPathExtent(pad) \
+ if ((q+(pad)) >= (ssize_t) max_strokes) \
{ \
- if (~max_strokes < (extent+6*BezierQuantum+360)) \
+ if (~max_strokes < (pad)) \
{ \
path_p=(PointInfo *) RelinquishMagickMemory(path_p); \
path_q=(PointInfo *) RelinquishMagickMemory(path_q); \
} \
else \
{ \
- max_strokes+=extent+6*BezierQuantum+360; \
+ max_strokes+=(pad); \
path_p=(PointInfo *) ResizeQuantumMemory(path_p,max_strokes, \
sizeof(*path_p)); \
path_q=(PointInfo *) ResizeQuantumMemory(path_q,max_strokes, \
box_q[3].y)/(slope.p-slope.q));
box_q[4].y=(double) (slope.p*(box_q[4].x-box_q[0].x)+box_q[0].y);
}
- CheckPathExtent(0);
+ CheckPathExtent(6*BezierQuantum-360);
dot_product=dx.q*dy.p-dx.p*dy.q;
if (dot_product <= 0.0)
switch (draw_info->linejoin)
theta.q+=2.0*MagickPI;
arc_segments=(size_t) ceil((double) ((theta.q-theta.p)/
(2.0*sqrt((double) (1.0/mid)))));
- CheckPathExtent(arc_segments);
+ CheckPathExtent(arc_segments+6*BezierQuantum-360);
path_q[q].x=box_q[1].x;
path_q[q].y=box_q[1].y;
q++;
theta.p+=2.0*MagickPI;
arc_segments=(size_t) ceil((double) ((theta.p-theta.q)/
(2.0*sqrt((double) (1.0/mid)))));
- CheckPathExtent(arc_segments);
+ CheckPathExtent(arc_segments+6*BezierQuantum-360);
path_p[p++]=box_p[1];
for (j=1; j < (ssize_t) arc_segments; j++)
{