From d5ea7aa3a0d7bd090711980d2cc94e97373d77a4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 25 Jan 2023 07:57:59 -0500 Subject: [PATCH] glyphpaintable: fix an off-by-one --- gtk/gtkglyphpaintable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gtkglyphpaintable.c b/gtk/gtkglyphpaintable.c index 97390e0d83..627f8b0464 100644 --- a/gtk/gtkglyphpaintable.c +++ b/gtk/gtkglyphpaintable.c @@ -75,10 +75,10 @@ gtk_glyph_paintable_snapshot_symbolic (GtkSymbolicPaintable *paintable, num_colors = self->num_palette_entries; custom_palette = self->custom_palette; } - else + else if (n_colors > 1) { - num_colors = n_colors; - custom_palette = (GdkRGBA *)colors; + num_colors = n_colors - 1; + custom_palette = (GdkRGBA *)&colors[1]; } node = gsk_glyph_node_new (&GRAPHENE_RECT_INIT (0, 0, width, height),