diff options
Diffstat (limited to 'sd/source/filter/eppt/pptexsoundcollection.cxx')
-rw-r--r-- | sd/source/filter/eppt/pptexsoundcollection.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sd/source/filter/eppt/pptexsoundcollection.cxx b/sd/source/filter/eppt/pptexsoundcollection.cxx index 2027ff3dd58c..24ee032c6ac6 100644 --- a/sd/source/filter/eppt/pptexsoundcollection.cxx +++ b/sd/source/filter/eppt/pptexsoundcollection.cxx @@ -129,16 +129,15 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const SvStream* pSourceFile = ::utl::UcbStreamHelper::CreateStream( aSoundURL, StreamMode::READ ); if ( pSourceFile ) { - sal_uInt8* pBuf = new sal_uInt8[ 0x10000 ]; // 64 kB Buffer + std::unique_ptr<sal_uInt8[]> pBuf( new sal_uInt8[ 0x10000 ] ); // 64 kB Buffer while ( nBytesLeft ) { sal_uInt32 nToDo = ( nBytesLeft > 0x10000 ) ? 0x10000 : nBytesLeft; - pSourceFile->ReadBytes(pBuf, nToDo); - rSt.WriteBytes(pBuf, nToDo); + pSourceFile->ReadBytes(pBuf.get(), nToDo); + rSt.WriteBytes(pBuf.get(), nToDo); nBytesLeft -= nToDo; } delete pSourceFile; - delete[] pBuf; } } catch( css::uno::Exception& ) |