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

Caolán McNamara caolanm at redhat.com
Fri Mar 10 12:58:12 UTC 2017


 vcl/source/filter/wmf/enhwmf.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit f50a3995c7b1ba31d68decfab4b2baf4f4df27df
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 10 12:56:31 2017 +0000

    ofz#797 truncate broken polygon to amount read
    
    to avoid super slow polygon math
    
    Change-Id: I30ef0afe96d9863df27ef7a4e7f7e8e7af36f8c1

diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 2674df3..6249b41 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -515,7 +515,11 @@ tools::Polygon EnhWMFReader::ReadPolygon(sal_uInt32 nStartIndex, sal_uInt32 nPoi
         T nX, nY;
         *pWMF >> nX >> nY;
         if (!pWMF->good())
+        {
+            SAL_WARN("vcl.emf", "short read on polygon, truncating");
+            aPolygon.SetSize(i);
             break;
+        }
         aPolygon[ i ] = Point( nX, nY );
     }
 


More information about the Libreoffice-commits mailing list