From 7abd5dcf10ea06fb5ba48077734222e7acc41065 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 23 Dec 2022 11:49:06 -0500 Subject: [PATCH] [ft-paint] Fix handling of colorstop iters --- src/hb-ft-colr.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hb-ft-colr.hh b/src/hb-ft-colr.hh index 4d8e24124..be8e940d2 100644 --- a/src/hb-ft-colr.hh +++ b/src/hb-ft-colr.hh @@ -91,6 +91,7 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line, { FT_ColorStop stop; unsigned wrote = 0; + FT_ColorStopIterator iter = c->color_stop_iterator; c->color_stop_iterator.current_color_stop = start; @@ -118,7 +119,11 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line, color_stops++; wrote++; } + *count = wrote; + + // reset the iterator for next time + c->color_stop_iterator = iter; } return c->color_stop_iterator.num_color_stops;