summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-04-23 15:48:41 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-24 08:59:29 +0200
commitaf84fc9d906626255aaf136eefc5e55236e0e8a6 (patch)
tree4e22bda9bc712517f6c1500ee56d50628700100f /include
parent75e3e7f2890438aadab28964c207f5308b7ffd4f (diff)
lazy image loading shouldn't read the entire .xls file (tdf#124828)
b11188835d3b87cd changed msfilter to use GraphicFilter::ImportUnloadedGraphic() to lazy-load images from the document. However, that function in some cases simply reads the entire rest of the passed SvStream, which in this case is the entire .xls file. And the document from tdf#124828 is ~50MiB and contains ~4000 images => 100+ GiB memory required. Change-Id: I74926383204ec642eabb28b62e2cf2e1ff8054a9 Reviewed-on: https://gerrit.libreoffice.org/71136 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/graphicfilter.hxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index b79cb18f9deb..9a8068d40f2f 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -294,7 +294,8 @@ public:
css::uno::Sequence< css::beans::PropertyValue >* pFilterData,
WmfExternal const *pExtHeader = nullptr );
- Graphic ImportUnloadedGraphic(SvStream& rIStream);
+ // Setting sizeLimit limits how much will be read from the stream.
+ Graphic ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 sizeLimit = 0);
const FilterErrorEx& GetLastError() const { return *pErrorEx;}
void ResetLastError();