diff options
author | Patrick Luby <plubius@libreoffice.org> | 2023-12-09 17:59:10 -0500 |
---|---|---|
committer | Patrick Luby <plubius@libreoffice.org> | 2023-12-10 19:40:57 +0100 |
commit | 9531f83cc73e26ce766713e575eb14152d118018 (patch) | |
tree | 8f2c0f1832a9921494a67db09c2114469a507636 /vcl/quartz/SystemFontList.cxx | |
parent | b5526d4e95a465bee9fc810794570023f2a76ca5 (diff) |
tdf#140401 check if attribute is a nullptr
Change-Id: Ie6e33fc1dca525553bb4237204666835d335b13f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160524
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@libreoffice.org>
Diffstat (limited to 'vcl/quartz/SystemFontList.cxx')
-rw-r--r-- | vcl/quartz/SystemFontList.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/quartz/SystemFontList.cxx b/vcl/quartz/SystemFontList.cxx index 2bc7544c8010..e068caf80fb6 100644 --- a/vcl/quartz/SystemFontList.cxx +++ b/vcl/quartz/SystemFontList.cxx @@ -118,7 +118,9 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont // get the font weight double fWeight = 0; CFNumberRef pWeightNum = static_cast<CFNumberRef>(CFDictionaryGetValue( pAttrDict, kCTFontWeightTrait )); - CFNumberGetValue( pWeightNum, kCFNumberDoubleType, &fWeight ); + // tdf#140401 check if attribute is a nullptr + if( pWeightNum ) + CFNumberGetValue( pWeightNum, kCFNumberDoubleType, &fWeight ); int nInt = WEIGHT_NORMAL; // Special case fixes @@ -164,7 +166,9 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont // get the font slant double fSlant = 0; CFNumberRef pSlantNum = static_cast<CFNumberRef>(CFDictionaryGetValue( pAttrDict, kCTFontSlantTrait )); - CFNumberGetValue( pSlantNum, kCFNumberDoubleType, &fSlant ); + // tdf#140401 check if attribute is a nullptr + if( pSlantNum ) + CFNumberGetValue( pSlantNum, kCFNumberDoubleType, &fSlant ); if( fSlant >= 0.035 ) { rDFA.SetItalic( ITALIC_NORMAL ); @@ -172,7 +176,9 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont // get width trait double fWidth = 0; CFNumberRef pWidthNum = static_cast<CFNumberRef>(CFDictionaryGetValue( pAttrDict, kCTFontWidthTrait )); - CFNumberGetValue( pWidthNum, kCFNumberDoubleType, &fWidth ); + // tdf#140401 check if attribute is a nullptr + if( pWidthNum ) + CFNumberGetValue( pWidthNum, kCFNumberDoubleType, &fWidth ); nInt = WIDTH_NORMAL; if( fWidth > 0 ) |