summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-06-03 10:16:26 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-06-03 15:16:27 +0200
commit2327f65ccf8231cef7e6ed4a9fb0df8dbdaa15f2 (patch)
treef5e907d9d881b02d10021ecdd0f94cd69b460d63 /oox
parent864dc65f8fb02348eaf0d83f38591f913342191f (diff)
Fixing crash with dereferencing front() and back() of an empty vector
Change-Id: If7204614aa7a650f4a2804fc63dd3301ece2281e (cherry picked from commit f5d6e7af69f6b8972bd97d1d8e2a6d9ec5a6294a)
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlshape.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1ec5c243ed56..35ad93d04731 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -769,7 +769,8 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes
for ( unsigned int i = 0; i < aFlagLists.size(); i++ )
aBezierCoords.Flags[i] = ContainerHelper::vectorToSequence( aFlagLists[i] );
- if( aCoordLists.front().front().X == aCoordLists.back().back().X
+ if( !aCoordLists.front().empty() && !aCoordLists.back().empty()
+ && aCoordLists.front().front().X == aCoordLists.back().back().X
&& aCoordLists.front().front().Y == aCoordLists.back().back().Y )
{ // HACK: If the shape is in fact closed, which can be found out only when the path is known,
// force to closed bezier shape (otherwise e.g. fill won't work).