summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-04 21:06:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-05 11:49:41 +0200
commiteca3b403293a2feb874acd7e38a79f2b60d0d266 (patch)
tree1abe14255c1ab8154180568bdb74e9e9d39e5ed8 /vcl
parentc52defd21c16f2438aed56ff62652a4883682ef0 (diff)
ofz: Timeout, break earlier on stream failure
Change-Id: If6612493224be5daa06288773c0aa1d22414c738 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121654 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/met/fail/hang-3.met (renamed from vcl/qa/cppunit/graphicfilter/data/met/pass/hang-3.met)bin608 -> 608 bytes
-rw-r--r--vcl/source/filter/imet/ios2met.cxx4
2 files changed, 2 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/met/pass/hang-3.met b/vcl/qa/cppunit/graphicfilter/data/met/fail/hang-3.met
index 84b432e63f69..84b432e63f69 100644
--- a/vcl/qa/cppunit/graphicfilter/data/met/pass/hang-3.met
+++ b/vcl/qa/cppunit/graphicfilter/data/met/fail/hang-3.met
Binary files differ
diff --git a/vcl/source/filter/imet/ios2met.cxx b/vcl/source/filter/imet/ios2met.cxx
index 09ef10a95aa5..cf1694ca04a5 100644
--- a/vcl/source/filter/imet/ios2met.cxx
+++ b/vcl/source/filter/imet/ios2met.cxx
@@ -1236,7 +1236,7 @@ void OS2METReader::ReadPolygons()
sal_uInt32 nNumPolys(0);
pOS2MET->ReadUChar(nFlags).ReadUInt32(nNumPolys);
- if (nNumPolys > SAL_MAX_UINT16)
+ if (!pOS2MET->good() || nNumPolys > SAL_MAX_UINT16)
{
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=11;
@@ -1249,7 +1249,7 @@ void OS2METReader::ReadPolygons()
pOS2MET->ReadUInt32(nNumPoints);
sal_uInt32 nLimit = SAL_MAX_UINT16;
if (i==0) --nLimit;
- if (nNumPoints > nLimit)
+ if (!pOS2MET->good() || nNumPoints > nLimit)
{
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=11;