[Libreoffice-commits] core.git: oox/source

Fridrich Å trba fridrich.strba at bluewin.ch
Mon Jun 3 01:17:26 PDT 2013


 oox/source/vml/vmlshape.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f5d6e7af69f6b8972bd97d1d8e2a6d9ec5a6294a
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Mon Jun 3 10:16:26 2013 +0200

    Fixing crash with dereferencing front() and back() of an empty vector
    
    Change-Id: If7204614aa7a650f4a2804fc63dd3301ece2281e

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1ec5c24..35ad93d 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).


More information about the Libreoffice-commits mailing list