[ftstroke] Fix unpredictable failures (#54986). * src/base/ftstroke.c (ft_sroke_border_lineto): Fix lineto check.
diff --git a/ChangeLog b/ChangeLog
index cd7b0ef..9f9c9a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2018-11-08 Alexei Podtelezhnikov <apodtele@gmail.com>
+ [ftstroke] Fix unpredictable failures (#54986).
+
+ * src/base/ftstroke.c (ft_sroke_border_lineto): Fix lineto check.
+
+2018-11-08 Alexei Podtelezhnikov <apodtele@gmail.com>
+
[ftstroke] Fix unpredictable failures (#54976).
* src/base/ftstroke.c (ft_sroke_border_close): Set the start tags.
diff --git a/src/base/ftstroke.c b/src/base/ftstroke.c
index 8a9e7db..fd74f8c 100644
--- a/src/base/ftstroke.c
+++ b/src/base/ftstroke.c
@@ -432,8 +432,8 @@
}
else
{
- /* don't add zero-length lineto */
- if ( border->num_points > 0 &&
+ /* don't add zero-length lineto, but always add moveto */
+ if ( border->num_points > (FT_UInt)border->start &&
FT_IS_SMALL( border->points[border->num_points - 1].x - to->x ) &&
FT_IS_SMALL( border->points[border->num_points - 1].y - to->y ) )
return error;