summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-02-18 00:22:05 +0000
committerMatthias Clasen <mclasen@redhat.com>2023-02-18 00:22:05 +0000
commitf28588f3ff56cec3bd4a0e3ec3ebb02f2e353634 (patch)
tree608780b32169501534c2287bb43021182020b736
parent5ecefd34a1594da879309f2b84296ea6f1a62a7b (diff)
parent23028362bc58a5d0a0288f3c9f0c5d1acbba5bde (diff)
downloadpango-f28588f3ff56cec3bd4a0e3ec3ebb02f2e353634.tar.gz
Merge branch 'fix/NULL-check-CTFontCollectionCreateMatchingFontDescriptors' into 'main'
[fix] Refrain from walking / freeing `cffaces` if null Closes #724 See merge request GNOME/pango!672
-rw-r--r--pango/pangocoretext-fontmap.c4
1 files 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.