[Libreoffice-commits] core.git: oox/source
Andras Timar
andras.timar at collabora.com
Sat May 30 06:21:24 PDT 2015
oox/source/export/drawingml.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit a819691ecc32586e800566d74ac22b474430d685
Author: Andras Timar <andras.timar at collabora.com>
Date: Sat May 30 13:39:14 2015 +0200
another DrawingML export crash fix
Change-Id: I0386b4a768a9ac51cb86ac1c3edb17c41caf821a
Reviewed-on: https://gerrit.libreoffice.org/15993
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3887e0e..b02e8b1 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 );
More information about the Libreoffice-commits
mailing list