diff options
author | Albert Astals Cid <aacid@kde.org> | 2022-12-12 23:28:55 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2022-12-12 23:30:25 +0100 |
commit | 09fdfecea3a13d30b5c52e1258d17549739d9ea8 (patch) | |
tree | c605f57095f9e77d59b7f077409cb351e547c2dd | |
parent | 6a19713ca8473c14905bd25d719757df5987d93b (diff) |
PDFDoc::sign: Fix crash if font can't be found
-rw-r--r-- | poppler/PDFDoc.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index a3c01e62..c46ed0c4 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -2174,6 +2174,10 @@ bool PDFDoc::sign(const char *saveFilename, const char *certNickname, const char pdfFontName = form->addFontToDefaultResources("Helvetica", "").fontName; } + if (pdfFontName.empty()) { + return false; + } + const DefaultAppearance da { { objName, pdfFontName.c_str() }, fontSize, std::move(fontColor) }; Object annotObj = Object(new Dict(getXRef())); |