chiark / gitweb /
Correct charstring stack accounting in emit_contour()
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 2 Nov 2024 22:10:33 +0000 (22:10 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Thu, 14 Nov 2024 22:27:18 +0000 (22:27 +0000)
The first point doesn't count because it gets an rmoveto rather than an
rlineto.

bedstead.c

index 605e2e26655d22d6ce50cad15b2fe73c427dfb8b..afdc75f7afc7cf87f1a3b7a6d704986def2a4409 100644 (file)
@@ -3571,7 +3571,7 @@ static void
 emit_contour(point *p0, vec *cur)
 {
        point *p = p0, *p1;
-       int stacksize = 0;
+       int stacksize = -2; /* Allow for initial rmoveto. */
 
        if (p->prev) p->prev->next = NULL; /* Break the loop. */
        do {