Skip to content

Commit

Permalink
Merge branch 'coretext-nullref' into 'main'
Browse files Browse the repository at this point in the history
Avoid null pointer dereference in ct_font_descriptor_get_traits.

See merge request GNOME/pango!784
  • Loading branch information
Matthias Clasen committed Dec 9, 2024
2 parents f1cc842 + 8133ece commit 37143e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pango/pangocoretext-fontmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ ct_font_descriptor_get_traits (CTFontDescriptorRef desc)
*/
dict = CTFontDescriptorCopyAttribute (desc, kCTFontTraitsAttribute);
cf_number = (CFNumberRef)CFDictionaryGetValue (dict, kCTFontSymbolicTrait);
if (!CFNumberGetValue (cf_number, kCFNumberSInt64Type, &traits))
if (!(cf_number && CFNumberGetValue (cf_number, kCFNumberSInt64Type, &traits)))
traits = 0;
CFRelease (dict);

Expand Down

0 comments on commit 37143e9

Please sign in to comment.