From 8d242aaa8ba7a2669fd7f1b393a2ba130ffb8544 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Jun 2022 16:36:08 -0600 Subject: [PATCH] [glyf] Rewrite a loop harmlessly I hope... --- src/OT/glyf/glyf.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index edc32e199..1df3f1578 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -171,7 +171,10 @@ struct glyf_accelerator_t if (consumer.is_consuming_contour_points ()) { - for (unsigned point_index = 0; point_index + 4 < all_points.length; ++point_index) + unsigned count = all_points.length; + assert (count >= glyf_impl::PHANTOM_COUNT); + count -= glyf_impl::PHANTOM_COUNT; + for (unsigned point_index = 0; point_index < count; point_index++) consumer.consume_point (all_points[point_index]); consumer.points_end (); }