From 23028362bc58a5d0a0288f3c9f0c5d1acbba5bde Mon Sep 17 00:00:00 2001 From: Dominique Quatravaux Date: Thu, 19 Jan 2023 21:47:18 +0100 Subject: [fix] Refrain from walking / freeing `cffaces` if null --- pango/pangocoretext-fontmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c index 6e59a4f9..7ce5ac08 100644 --- a/pango/pangocoretext-fontmap.c +++ b/pango/pangocoretext-fontmap.c @@ -646,7 +646,7 @@ pango_core_text_family_list_faces (PangoFontFamily *family, italic_faces = g_hash_table_new (g_direct_hash, g_direct_equal); - count = CFArrayGetCount (ctfaces); + count = ctfaces ? CFArrayGetCount (ctfaces) : 0; for (i = 0; i < count; i++) { PangoCoreTextFace *face; @@ -666,7 +666,7 @@ pango_core_text_family_list_faces (PangoFontFamily *family, CFRelease (font_descriptors); CFRelease (attributes); - CFRelease (ctfaces); + if (ctfaces) CFRelease (ctfaces); /* For all fonts for which a non-synthetic italic variant does * not exist on the system, we create synthesized versions here. -- cgit v1.2.1