crashtesting: ZCodec::Read return -1 on failure
Change-Id: If7c4bcfc0c03bdab3209d27f0e8fa75a498feae1
Reviewed-on: https://gerrit.libreoffice.org/55844
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index ddc81b4..b143bfe 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)