hwpfilter/source/hwpreader.cxx | 7 ++++++- svx/source/svdraw/svdpdf.cxx | 10 +++++++++- xmloff/source/style/xmlnumi.cxx | 9 ++++++--- 3 files changed, 21 insertions(+), 5 deletions(-)
New commits: commit 329ac554722b17cb0f06322ac9cc1a765c0d229b Author: Caolán McNamara <[email protected]> AuthorDate: Sun Mar 1 21:11:35 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Mar 2 09:12:08 2026 +0100 ofz#474183568 Integer-overflow drop the bogus values at the import site Change-Id: I01627cdf58491cbeabf7b5543c65b33b3062ceb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200733 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index caa67a77c4f3..3773094c56ad 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -19,6 +19,7 @@ #include <svdpdf.hxx> +#include <limits> #include <tools/stream.hxx> #include <tools/UnitConversion.hxx> #include <vcl/canvastools.hxx> @@ -2167,7 +2168,14 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con float fWidth = pPageObject->getStrokeWidth(); const double dWidth = 0.5 * fabs(std::hypot(aPathMatrix.a(), aPathMatrix.c()) * fWidth); - mnLineWidth = convertPointToMm100(dWidth); + const double fLineWidth = convertPointToMm100(dWidth); + if (fLineWidth < 0 || fLineWidth > std::numeric_limits<sal_Int32>::max()) + { + SAL_WARN("sd.filter", "Ignoring bogus line width: " << fLineWidth); + mnLineWidth = 0; + } + else + mnLineWidth = static_cast<sal_Int32>(fLineWidth); vcl::pdf::PDFFillMode nFillMode = vcl::pdf::PDFFillMode::Alternate; bool bStroke = true; // Assume we have to draw, unless told otherwise. commit ba2fb4af99f05a8a8a48d8fbc51bd232a91d634e Author: Caolán McNamara <[email protected]> AuthorDate: Sun Mar 1 20:56:13 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Mar 2 09:12:01 2026 +0100 ofz#421997573 Timeout clip nNumDisplayLevels import like export does in SvxXMLNumRuleExport::exportLevelStyle Change-Id: I1ddc49a9c70155b9ac6f218cc9d453c36302302f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200732 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 8019855f6b16..487af94ab5d8 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -61,6 +61,7 @@ #include <xmloff/maptype.hxx> #include <xmloff/xmlnumi.hxx> +#include <algorithm> #include <optional> using namespace ::com::sun::star; @@ -407,12 +408,14 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties() // Generate list format string, based on this sListFormat = std::make_optional(sPrefix); - for (int i = 1; i <= nNumDisplayLevels; i++) + // Can't display more levels than exist + sal_Int32 nDisplayLevels = std::min<sal_Int32>(nNumDisplayLevels, nLevel + 1); + for (int i = 1; i <= nDisplayLevels; i++) { *sListFormat += "%"; - *sListFormat += OUString::number(nLevel - nNumDisplayLevels + i + 1); + *sListFormat += OUString::number(nLevel - nDisplayLevels + i + 1); *sListFormat += "%"; - if (i != nNumDisplayLevels) + if (i != nDisplayLevels) *sListFormat += "."; // Default separator for older ODT } commit 5bd6ce333a1e21c68858120d22cac7e25d591f8b Author: Caolán McNamara <[email protected]> AuthorDate: Sun Mar 1 19:48:00 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Mar 2 09:11:53 2026 +0100 ofz#481418344 Timeout Change-Id: I12d5cc145e3d2cf156d2b1d30b50d9d9d25a25e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200730 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index ae507b62c4ce..3746fa4cf497 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -1486,6 +1486,11 @@ void HwpReader::makePageStyle() pmCount = 512; } + OUString sBackInfoEncoded; + // Do this once, so if we need it we don't end up with many duplicate strings of the background image + if (hwpinfo.back_info.isset && hwpinfo.back_info.type == 2 && hwpinfo.back_info.size > 0) + sBackInfoEncoded = base64_encode_string(reinterpret_cast<unsigned char*>(hwpinfo.back_info.data.data()), hwpinfo.back_info.size); + for( int i = 0 ; i < pmCount ; i++ ){ mxList->addAttribute(u"style:name"_ustr, sXML_CDATA, "pm" + OUString::number(i + 1)); startEl(u"style:page-master"_ustr); @@ -1680,7 +1685,7 @@ void HwpReader::makePageStyle() if( hwpinfo.back_info.type == 2 ){ startEl(u"office:binary-data"_ustr); mxList->clear(); - chars(base64_encode_string(reinterpret_cast<unsigned char*>(hwpinfo.back_info.data.data()), hwpinfo.back_info.size)); + chars(sBackInfoEncoded); endEl(u"office:binary-data"_ustr); } endEl(u"style:background-image"_ustr);
