Resolves: rhbz#1900937 fix null deref in non-pdfium build

f41
Caolán McNamara 4 years ago
parent ee1acf3a0e
commit 28fcd754fc

@ -0,0 +1,36 @@
From 3c19d5bd51673d3ec776ac7b3a4e43137b98b789 Mon Sep 17 00:00:00 2001
From: Noel Grandin <noelgrandin@gmail.com>
Date: Thu, 20 Aug 2020 21:54:25 +0200
Subject: [PATCH] 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@collabora.co.uk>
(cherry picked from commit 17798a503bc67f2a38f4b558e37447d1ea8f4623)
---
filter/source/pdf/pdfdecomposer.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/filter/source/pdf/pdfdecomposer.cxx b/filter/source/pdf/pdfdecomposer.cxx
index e053fd215369..e54206e4c175 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -70,7 +70,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]);
--
2.28.0

@ -50,7 +50,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.1
Release: 3%{?libo_prerelease}%{?dist}
Release: 4%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0
URL: http://www.libreoffice.org/
@ -253,6 +253,7 @@ Patch8: 0001-rhbz-1891326-suggest-package-install-of-the-most-app.patch
Patch9: 0001-fix-disable-pdfium-build.patch
Patch10: 0001-gcc11.patch
Patch11: 0001-Resolves-rhbz-1900428-don-t-crash-on-invalid-index-u.patch
Patch12: 0001-fix-unit-test-with-non-pdfium-build.patch
# Patches with numbers above 100 are applied conditionally
Patch101: 0001-Upgrade-liborcus-to-0.16.0.patch
@ -2265,6 +2266,9 @@ done
%{_includedir}/LibreOfficeKit
%changelog
* Tue Nov 24 2020 Caolán McNamara <caolanm@redhat.com> - 1:7.0.3.1-4
- Resolves: rhbz#1900937 fix null deref in non-pdfium build
* Mon Nov 23 2020 Caolán McNamara <caolanm@redhat.com> - 1:7.0.3.1-3
- Resolves: rhbz#1900428 don't crash on invalid index used in StarBasic macro

Loading…
Cancel
Save