diff options
author | Andras Timar <andras.timar@collabora.com> | 2015-05-30 13:39:14 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-05-30 15:24:53 +0200 |
commit | 078a9feb1b6c0839cc9c9822584e8dfbc6d930bf (patch) | |
tree | a538ca44bf3ebe2183d7aaad78eb0e79ed87ec04 /oox | |
parent | 751a2cdc5987031d28424b5a2cf8c3ab79d24966 (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>
(cherry picked from commit a819691ecc32586e800566d74ac22b474430d685)
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0becb68bc500..15a8cb7df191 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 ); |