diff options
Diffstat (limited to 'sd/source/filter/ppt/pptin.cxx')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 0679a1e7d61c..cb3283935a3e 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1951,14 +1951,14 @@ OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const aGalleryUserSound.Append( aRetval ); sal_uInt32 nSoundDataLen = aSoundDataRecHd.nRecLen; - sal_uInt8* pBuf = new sal_uInt8[ nSoundDataLen ]; + std::unique_ptr<sal_uInt8[]> pBuf( new sal_uInt8[ nSoundDataLen ] ); - rStCtrl.ReadBytes(pBuf, nSoundDataLen); + rStCtrl.ReadBytes(pBuf.get(), nSoundDataLen); SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aGalleryUserSound.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE | StreamMode::TRUNC ); if( pOStm ) { - pOStm->WriteBytes(pBuf, nSoundDataLen); + pOStm->WriteBytes(pBuf.get(), nSoundDataLen); if( pOStm->GetError() == ERRCODE_NONE ) { @@ -1968,8 +1968,6 @@ OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const delete pOStm; } - - delete[] pBuf; } } } |