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

Mike Kaganski mikekaganski at hotmail.com
Thu May 7 08:53:20 PDT 2015


 sw/source/filter/ww8/wrtww8gr.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a612c2ee5f6e9c40f33e7aa1b8d79ffee5cb4c9b
Author: Mike Kaganski <mikekaganski at hotmail.com>
Date:   Fri May 8 00:12:54 2015 +1000

    tdf#55665: Fix a corner case OLE processing
    
    This fixes two problems with WW8Export::TestOleNeedsGraphic:
    1. not testing for NULL pGraphicsStream pointer,
    2. not releasing that pointer in all cases.
    
    Change-Id: I67921aec3ce0cb131359e66ee3a6a136d76952a0
    Reviewed-on: https://gerrit.libreoffice.org/15667
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index f3776bc..853c5c0 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -179,15 +179,14 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
                         delete pGraphicStream;
                         pGraphicStream =
                                 ::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( pRet->GetObjRef() ) );
-                        if( rGF.ImportGraphic( aGr2, OUString(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+                        if( pGraphicStream && rGF.ImportGraphic( aGr2, OUString(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
                         {
                             if ( aGr1 == aGr2 )
                                 bGraphicNeeded = false;
                         }
                     }
                 }
-                else
-                    delete pGraphicStream;
+                delete pGraphicStream;
             }
 
             delete pRet;


More information about the Libreoffice-commits mailing list