summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-15 09:07:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-15 14:25:39 +0200
commit5f7025c9aaad534ff835ddbda811bccbb53e031a (patch)
tree5660d805690bd63fc89ce8600cfd24a510c0fe18 /filter/source
parent2e2d58f1c868287df27628ee09a1d76b6f447474 (diff)
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>
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/svg/svgfilter.cxx7
1 files changed, 5 insertions, 2 deletions
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)