From 43e82682c58e354adc92cbbb0c95f721d019efab Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 5 Mar 2025 17:40:46 -0700 Subject: [PATCH] [cairo] Fix infinite loop in sweep-gradient code Tested with U+F1314 from var font from: https://github.com/googlefonts/color-fonts/blob/main/glyph_descriptions.md --- src/hb-cairo-utils.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-cairo-utils.cc b/src/hb-cairo-utils.cc index ec1499e86..85c62d39a 100644 --- a/src/hb-cairo-utils.cc +++ b/src/hb-cairo-utils.cc @@ -726,6 +726,9 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops, float span; span = angles[n_stops - 1] - angles[0]; + if (!span) + goto done; + k = 0; if (angles[0] >= 0) {