diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-02-18 00:22:05 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-02-18 00:22:05 +0000 |
commit | f28588f3ff56cec3bd4a0e3ec3ebb02f2e353634 (patch) | |
tree | 608780b32169501534c2287bb43021182020b736 /pango | |
parent | 5ecefd34a1594da879309f2b84296ea6f1a62a7b (diff) | |
parent | 23028362bc58a5d0a0288f3c9f0c5d1acbba5bde (diff) | |
download | pango-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
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pangocoretext-fontmap.c | 4 |
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. |