diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-13 08:33:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-07-13 08:42:04 +0100 |
commit | 7df4d8544c6b12e31bcb81d9389d03ae7c11bfea (patch) | |
tree | 2b8da9c76fbf43cb691fea1862a94ecd6e5d01b9 | |
parent | 5d75fc9dbbff29e531348a36d5cb49a5ca0d611d (diff) |
emf: test for empty polygons
Change-Id: I3c8896230e3d48a37f4b8d702b0f673e44f45ba4
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf | bin | 0 -> 3848 bytes | |||
-rw-r--r-- | vcl/source/filter/wmf/winmtf.cxx | 26 |
2 files changed, 15 insertions, 11 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf b/vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf Binary files differnew file mode 100644 index 000000000000..6adabec8b31c --- /dev/null +++ b/vcl/qa/cppunit/graphicfilter/data/emf/fail/crash-2.emf diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index c77088989a16..f63ebac3c30e 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -1294,18 +1294,22 @@ void WinMtfOutput::DrawPolyLine( Polygon& rPolygon, bool bTo, bool bRecordPath ) { UpdateClipRegion(); - ImplMap( rPolygon ); - if ( bTo ) - { - rPolygon[ 0 ] = maActPos; - maActPos = rPolygon[ rPolygon.GetSize() - 1 ]; - } - if ( bRecordPath ) - aPathObj.AddPolyLine( rPolygon ); - else + sal_uInt16 nPoints = rPolygon.GetSize(); + if (nPoints >= 1) { - UpdateLineStyle(); - mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) ); + ImplMap( rPolygon ); + if ( bTo ) + { + rPolygon[ 0 ] = maActPos; + maActPos = rPolygon[ rPolygon.GetSize() - 1 ]; + } + if ( bRecordPath ) + aPathObj.AddPolyLine( rPolygon ); + else + { + UpdateLineStyle(); + mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) ); + } } } |