From 28fcd754fc9953c3c882b803ae74324e8db3202a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Nov 24 2020 14:46:03 +0000 Subject: Resolves: rhbz#1900937 fix null deref in non-pdfium build --- diff --git a/0001-fix-unit-test-with-non-pdfium-build.patch b/0001-fix-unit-test-with-non-pdfium-build.patch new file mode 100644 index 0000000..4fd6fe2 --- /dev/null +++ b/0001-fix-unit-test-with-non-pdfium-build.patch @@ -0,0 +1,36 @@ +From 3c19d5bd51673d3ec776ac7b3a4e43137b98b789 Mon Sep 17 00:00:00 2001 +From: Noel Grandin +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 +(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> SAL_CALL XPdfDecomposer::ge + nPageIndex = 0; + + std::vector 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 + diff --git a/libreoffice.spec b/libreoffice.spec index eefcfef..fdfa39f 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -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 - 1:7.0.3.1-4 +- Resolves: rhbz#1900937 fix null deref in non-pdfium build + * Mon Nov 23 2020 Caolán McNamara - 1:7.0.3.1-3 - Resolves: rhbz#1900428 don't crash on invalid index used in StarBasic macro