summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorDominique Quatravaux <dominique.quatravaux@epfl.ch>2023-01-19 21:47:18 +0100
committerDominique Quatravaux <dominique.quatravaux@epfl.ch>2023-01-19 21:48:50 +0100
commit23028362bc58a5d0a0288f3c9f0c5d1acbba5bde (patch)
treef97f1f3d80d6b4e378ed6a4ec7bef823d78ed63e /pango
parent7b4a7d6dc00365289bece029e6698d01441bfb1f (diff)
downloadpango-23028362bc58a5d0a0288f3c9f0c5d1acbba5bde.tar.gz
[fix] Refrain from walking / freeing `cffaces` if null
Diffstat (limited to 'pango')
-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.