summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2015-05-30 13:39:14 +0200
committerAndras Timar <andras.timar@collabora.com>2015-05-30 13:21:03 +0000
commita819691ecc32586e800566d74ac22b474430d685 (patch)
treeaf5d2211ef3f53cdb40bd95e87f5ea06bd4b0d8a /oox
parent1f19bc5de3e0f4eb89c4ebc3b74319ccff138ada (diff)
another DrawingML export crash fix
Change-Id: I0386b4a768a9ac51cb86ac1c3edb17c41caf821a Reviewed-on: https://gerrit.libreoffice.org/15993 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3887e0eae865..b02e8b1741c4 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2253,6 +2253,18 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
if ( !aPairs.hasElements() || !aSegments.hasElements() )
return;
+ int nExpectedPairCount = 0;
+ for( int j = 0; j < aSegments.getLength(); ++j )
+ {
+ nExpectedPairCount += aSegments[j].Count;
+ }
+
+ if ( nExpectedPairCount > aPairs.getLength() )
+ {
+ SAL_WARN("oox", "Segments need " << nExpectedPairCount << " coordinates, but Coordinates have only " << aPairs.getLength() << " pairs.");
+ return;
+ }
+
mpFS->startElementNS( XML_a, XML_custGeom, FSEND );
mpFS->singleElementNS( XML_a, XML_avLst, FSEND );
mpFS->singleElementNS( XML_a, XML_gdLst, FSEND );