diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-10-20 21:07:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-10-21 14:44:31 +0200 |
commit | b16d11c9d85f60867f634f5049e38c1f62d8d412 (patch) | |
tree | ff4fefd9d8910c29bb03e50e2da4fe039292d799 /xmlsecurity | |
parent | 915c7529e9b041879e8c63f15306028a6f649f48 (diff) |
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@collabora.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/helper/pdfsignaturehelper.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
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; |