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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Mike Kaganski
2015-05-08 00:12:54 +10:00
committed by Caolán McNamara
parent a1bfad005c
commit a612c2ee5f

View File

@@ -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;