poppler/PDFDoc.cc | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 09fdfecea3a13d30b5c52e1258d17549739d9ea8
Author: Albert Astals Cid <[email protected]>
Date: Mon Dec 12 23:28:55 2022 +0100
PDFDoc::sign: Fix crash if font can't be found
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()));