From af174dbad4f4dc896bc090215d08c12d080b8e72 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 20 Sep 2020 11:36:19 +0100 Subject: cid#1466875 Dereference null return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6208d2d6e6592db89223c8a8705f7f1ba066f16e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103068 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/gdi/salgdilayout.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/source') diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 02c316b7b39d..f277970b6671 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -1020,6 +1020,8 @@ bool SalGraphics::CreateCFFfontSubset(const unsigned char* pFontBytes, int nByte int nGlyphCount, FontSubsetInfo& rInfo) { FILE* pOutFile = fopen(rSysPath.getStr(), "wb"); + if (!pOutFile) + return false; rInfo.LoadFont(FontType::CFF_FONT, pFontBytes, nByteLength); bool bRet = rInfo.CreateFontSubset(FontType::TYPE1_PFB, pOutFile, nullptr, pGlyphIds, pEncoding, nGlyphCount, pGlyphWidths); -- cgit v1.2.3