summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2023-02-20 17:13:40 +0000
committerAlexei Podtelezhnikov <apodtele@gmail.com>2023-02-20 17:13:40 +0000
commitfecd19b449c5b8a5a3a935466df1e5a9c5bcc0bd (patch)
tree6af7e1b8b5c86d7125bd3aff47d340254193ebe8
parent34ed28d0fbf0552e0c0106007585e27fd163bf36 (diff)
downloadfreetype2-fecd19b449c5b8a5a3a935466df1e5a9c5bcc0bd.tar.gz
* src/base/ftstroke.c (FT_Stroker_ParseOutline): Clean up contour indexing.
-rw-r--r--src/base/ftstroke.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/base/ftstroke.c b/src/base/ftstroke.c
index db358e772..92f1e4308 100644
--- a/src/base/ftstroke.c
+++ b/src/base/ftstroke.c
@@ -2055,7 +2055,9 @@
FT_Error error;
FT_Int n; /* index of contour in outline */
- FT_UInt first; /* index of first point in contour */
+ FT_Int first; /* index of first point in contour */
+ FT_Int last; /* index of last point in contour */
+
FT_Int tag; /* current point's state */
@@ -2067,22 +2069,17 @@
FT_Stroker_Rewind( stroker );
- first = 0;
-
+ last = -1;
for ( n = 0; n < outline->n_contours; n++ )
{
- FT_UInt last; /* index of last point in contour */
-
-
- last = (FT_UInt)outline->contours[n];
- limit = outline->points + last;
+ first = last + 1;
+ last = outline->contours[n];
/* skip empty points; we don't stroke these */
if ( last <= first )
- {
- first = last + 1;
continue;
- }
+
+ limit = outline->points + last;
v_start = outline->points[first];
v_last = outline->points[last];
@@ -2231,8 +2228,6 @@
if ( error )
goto Exit;
}
-
- first = last + 1;
}
return FT_Err_Ok;