[Libreoffice-commits] .: Branch 'libreoffice-3-3' - filter/source

Petr Mladek pmladek at kemper.freedesktop.org
Wed Feb 2 08:10:33 PST 2011


 filter/source/msfilter/escherex.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 780535edc21bc230a859d672b7408f10e2691a38
Author: Petr Mladek <pmladek at suse.cz>
Date:   Wed Feb 2 17:09:03 2011 +0100

    RTF export crasher (bnc#656503)
    
    Signed off by Cedric

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index cc561b8..7a14c2f 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4372,6 +4372,10 @@ sal_uInt32 EscherExGlobal::GenerateDrawingId()
 sal_uInt32 EscherExGlobal::GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr )
 {
     // drawing identifier is one-based
+    // make sure the drawing is valid (bnc#656503)
+    if ( nDrawingId == 0 )
+        return 0;
+    // create index from the identifier
     size_t nDrawingIdx = nDrawingId - 1;
     OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GenerateShapeId - invalid drawing ID" );
     if( nDrawingIdx >= maDrawingInfos.size() )
@@ -4472,6 +4476,8 @@ EscherEx::EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm ) :
     mxGlobal                ( rxGlobal ),
     mpOutStrm				( &rOutStrm ),
 
+    mnCurrentDg                         ( 0 ),
+
     mnGroupLevel			( 0 ),
     mnHellLayerId			( USHRT_MAX ),
 


More information about the Libreoffice-commits mailing list