sw/source/filter/xml/xmlimp.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit e4ee999d6d9c10ee10d6778eca9354d8fbaa720f Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Jul 23 21:34:23 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jul 23 22:48:05 2023 +0200 ofz#60533 Timeout with fo:font-size="842pt" We end up exporting thousands of pages from minimal input size and time out, so just export up to some semi-reasonable amount of pages. Change-Id: I98667b4b94f10ab50e2d8e3f5bb58c8c75a77130 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154814 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 4287a6848f4c..8e5362451052 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1843,9 +1843,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream) if (ret) { - utl::MediaDescriptor aMediaDescriptor; - aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); - utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); @@ -1857,9 +1854,15 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream) SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE); uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aOutputStream)); + // ofz#60533 fuzzer learned to use fo:font-size="842pt" which generate timeouts trying + // to export thousands of pages from minimal input size + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "PageRange", uno::Any(OUString("1-100")) } + })); uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer_pdf_Export")) }, - { "OutputStream", uno::Any(xOutputStream) } + { "OutputStream", uno::Any(xOutputStream) }, + { "FilterData", uno::Any(aFilterData) } })); xPDFFilter->filter(aDescriptor); aOutputStream.Close();