From ef9de3c26359b24e4ba73c0491f9fa6c3a67aaf3 Mon Sep 17 00:00:00 2001 From: Jehan Date: Fri, 12 Apr 2024 12:19:33 +0200 Subject: [PATCH] app: initialize font to NULL. In case there are no fonts loaded (which may happen in particular when starting with --no-fonts), we need to make sure that font is initialized to NULL so that we can return the standard GimpFont object and not a broken pointer. Thanks to Idriss for the additional diagnosis, which would hopefully complete commit 5dc86277e6 and take care of #11219. --- app/text/gimpfont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/text/gimpfont.c b/app/text/gimpfont.c index fe44c114a2..e2837e992c 100644 --- a/app/text/gimpfont.c +++ b/app/text/gimpfont.c @@ -237,7 +237,7 @@ gimp_font_deserialize_create (GType type, gint nest_level, gpointer data) { - GimpFont *font; + GimpFont *font = NULL; GimpContainer *fonts_container = GIMP_FONT_CLASS (g_type_class_peek (GIMP_TYPE_FONT))->fonts_container; gint most_similar_font_index = -1; gint font_count = gimp_container_get_n_children (fonts_container);