[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Fri Jun 15 09:22:45 UTC 2018
filter/source/svg/svgfilter.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 26867c39dc0da66f0bc753301096fcd105417c18
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 15 09:07:52 2018 +0100
crashtesting: ZCodec::Read return -1 on failure
Change-Id: If7c4bcfc0c03bdab3209d27f0e8fa75a498feae1
Reviewed-on: https://gerrit.libreoffice.org/55842
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index ddc81b4f89e5..b143bfef55cc 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -486,7 +486,7 @@ private:
const uno::Reference<io::XInputStream>& mxInput;
uno::Sequence< sal_Int8 > mnFirstBytes;
sal_Int32 mnFirstBytesSize;
- sal_uInt64 mnFirstRead;
+ sal_Int32 mnFirstRead;
bool mbProcessed;
bool mbIsSVG;
@@ -555,7 +555,7 @@ private:
}
// check if it is gzipped -> svgz
- if(mnFirstBytes[0] == 0x1F && static_cast<sal_uInt8>(mnFirstBytes[1]) == 0x8B)
+ if (mnFirstBytes[0] == 0x1F && static_cast<sal_uInt8>(mnFirstBytes[1]) == 0x8B)
{
ZCodec aCodec;
@@ -568,6 +568,9 @@ private:
reinterpret_cast< sal_uInt8* >(mnFirstBytes.getArray()),
mnFirstBytesSize);
aCodec.EndCompression();
+
+ if (mnFirstRead < 0)
+ return;
}
if(!mbIsSVG)
More information about the Libreoffice-commits
mailing list