From: kramm Date: Sun, 6 Apr 2008 16:49:26 +0000 (+0000) Subject: fixed a double free and a mem leak X-Git-Tag: buttons-working~267 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=dfba6bfdccac042f4bb27bca73e604f82063056a fixed a double free and a mem leak --- diff --git a/lib/devices/polyops.c b/lib/devices/polyops.c index 1a71c1f..ab9aa8c 100644 --- a/lib/devices/polyops.c +++ b/lib/devices/polyops.c @@ -152,8 +152,8 @@ void polyops_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color) if(i->clip) { gfxpoly_t*old = poly; - poly = gfxpoly_intersect(poly, i->clip->poly); - gfxpoly_free(poly); + poly = gfxpoly_intersect(poly, i->clip->poly); + gfxpoly_free(old); } addtounion(dev,poly); gfxline_t*gfxline = gfxpoly_to_gfxline(poly); @@ -259,6 +259,10 @@ gfxresult_t* polyops_finish(struct _gfxdevice*dev) { dbg("polyops_finish"); internal_t*i = (internal_t*)dev->internal; + + if(i->polyunion) { + gfxpoly_free(i->polyunion);i->polyunion=0; + } if(i->out) { return i->out->finish(i->out); } else {