- Fix leak when no fill is done (ilia)

This commit is contained in:
Pierre Joye 2003-07-23 00:23:21 +00:00
parent 28bc693d3a
commit dc0606f041

View File

@ -1869,12 +1869,13 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc)
return;
}
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
sp = stack;
wx2=im->sx;wy2=im->sy;
oc = gdImageGetPixel(im, x, y);
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) return;
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
sp = stack;
/* required! */
FILL_PUSH(y,x,x,1);
/* seed segment (popped 1st) */