[Libreoffice-commits] core.git: xmlsecurity/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 21 12:45:11 UTC 2020


 xmlsecurity/source/helper/pdfsignaturehelper.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit b16d11c9d85f60867f634f5049e38c1f62d8d412
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Oct 20 21:07:23 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Oct 21 14:44:31 2020 +0200

    xmlsecurity: clean up last raw pdfium call
    
    Change-Id: I4e6f28ef181fff5b7fc431aa01763370bb48476d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104577
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
index 6864c715cb86..f7427337fd1e 100644
--- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
@@ -231,13 +231,17 @@ void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<BitmapChecksum
                              int nMDPPerm)
 {
     auto pPdfium = vcl::pdf::PDFiumLibrary::get();
-    vcl::pdf::PDFiumDocument aPdfDocument(
-        FPDF_LoadMemDocument(rStream.GetData(), rStream.GetSize(), /*password=*/nullptr));
+    std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
+        = pPdfium->openDocument(rStream.GetData(), rStream.GetSize());
+    if (!pPdfDocument)
+    {
+        return;
+    }
 
-    int nPageCount = aPdfDocument.getPageCount();
+    int nPageCount = pPdfDocument->getPageCount();
     for (int nPage = 0; nPage < nPageCount; ++nPage)
     {
-        std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage(aPdfDocument.openPage(nPage));
+        std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(nPage);
         if (!pPdfPage)
         {
             return;


More information about the Libreoffice-commits mailing list