[poppler] poppler/PDFDoc.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 12 22:34:04 UTC 2022


 poppler/PDFDoc.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 09fdfecea3a13d30b5c52e1258d17549739d9ea8
Author: Albert Astals Cid <aacid at kde.org>
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()));


More information about the poppler mailing list