summaryrefslogtreecommitdiff
path: root/clip.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-10-05 10:07:34 +0000
committerrodri <rgl@antares-labs.eu>2024-10-05 10:07:34 +0000
commita09cfff78a96a10169a30324b75554827945fed4 (patch)
treec5df96a71fc78492aecc6a51ef928e437ac828f0 /clip.c
parent91dfb6853d7b6d7ae49f54488b89e0eb73b5ff01 (diff)
downloadlibgraphics-a09cfff78a96a10169a30324b75554827945fed4.tar.gz
libgraphics-a09cfff78a96a10169a30324b75554827945fed4.tar.bz2
libgraphics-a09cfff78a96a10169a30324b75554827945fed4.zip
patch a leak in rectclipline. fix a pixel-discarding logic statement.
Diffstat (limited to 'clip.c')
-rw-r--r--clip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/clip.c b/clip.c
index 14fdc7f..95f99a2 100644
--- a/clip.c
+++ b/clip.c
@@ -199,8 +199,10 @@ adjustverts(Point *p0, Point *p1, Vertex *v0, Vertex *v1)
perc = len == 0? 0: hypot(Δp.x, Δp.y)/len;
lerpvertex(&v[1], v0, v1, perc);
- *v0 = dupvertex(&v[0]);
- *v1 = dupvertex(&v[1]);
+ delvattrs(v0);
+ delvattrs(v1);
+ *v0 = v[0];
+ *v1 = v[1];
}
/*