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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 21 09:39:02 UTC 2020


 filter/source/pdf/pdfdecomposer.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 17798a503bc67f2a38f4b558e37447d1ea8f4623
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Thu Aug 20 21:54:25 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 21 11:38:22 2020 +0200

    fix unit-test with non-pdfium build
    
    otherwise testSwappingPageNumber will crash accessing out of
    bounds element in vector.
    
    Change-Id: I07499e79d523931e1f3cc02a5150f033e1ea9578
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101094
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/pdf/pdfdecomposer.cxx b/filter/source/pdf/pdfdecomposer.cxx
index b2f572fe6c6f..a7f11cc6588e 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -68,7 +68,10 @@ uno::Sequence<uno::Reference<graphic::XPrimitive2D>> SAL_CALL XPdfDecomposer::ge
         nPageIndex = 0;
 
     std::vector<Bitmap> aBitmaps;
-    vcl::RenderPDFBitmaps(xPdfData.getConstArray(), xPdfData.getLength(), aBitmaps, nPageIndex, 1);
+    int rv = vcl::RenderPDFBitmaps(xPdfData.getConstArray(), xPdfData.getLength(), aBitmaps,
+                                   nPageIndex, 1);
+    if (rv == 0)
+        return {}; // happens if we do not have PDFium
 
     BitmapEx aReplacement(aBitmaps[0]);
 


More information about the Libreoffice-commits mailing list