[Libreoffice-commits] core.git: vcl/qa vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 5 09:50:17 UTC 2021


 vcl/source/filter/imet/ios2met.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit eca3b403293a2feb874acd7e38a79f2b60d0d266
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Sep 4 21:06:46 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Sep 5 11:49:41 2021 +0200

    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 at redhat.com>

diff --git a/vcl/qa/cppunit/graphicfilter/data/met/pass/hang-3.met b/vcl/qa/cppunit/graphicfilter/data/met/fail/hang-3.met
similarity index 100%
rename from vcl/qa/cppunit/graphicfilter/data/met/pass/hang-3.met
rename to 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;


More information about the Libreoffice-commits mailing list