diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-04 21:06:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 11:49:41 +0200 |
commit | eca3b403293a2feb874acd7e38a79f2b60d0d266 (patch) | |
tree | 1abe14255c1ab8154180568bdb74e9e9d39e5ed8 /vcl | |
parent | c52defd21c16f2438aed56ff62652a4883682ef0 (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) | bin | 608 -> 608 bytes | |||
-rw-r--r-- | vcl/source/filter/imet/ios2met.cxx | 4 |
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 Binary files differindex 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 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; |