summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-18 12:35:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-18 12:38:05 +0000
commit23a7498fddf5b0f042deeede63c60334c06b787b (patch)
tree539a10714d280cdd9010225e5b1821301c46b75f
parent109210e5b71a4e0b6fcaae72be7ef8d7667f3708 (diff)
valgrind: uninitialized value
and can use a simple vector here Change-Id: If27e881c4ae7a1a068fdbb1c0a689ecc78804095
-rw-r--r--sd/source/filter/ppt/propread.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 8eb2daf523e2..ae515dd84a49 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -569,26 +569,25 @@ void PropRead::Read()
if ( mbStatus )
{
- sal_uInt32 nSections;
- sal_uInt32 nSectionOfs;
- sal_uInt32 nCurrent;
mpSvStream->ReadUInt16( mnByteOrder ).ReadUInt16( mnFormat ).ReadUInt16( mnVersionLo ).ReadUInt16( mnVersionHi );
if ( mnByteOrder == 0xfffe )
{
- std::unique_ptr<sal_uInt8[]> pSectCLSID( new sal_uInt8[ 16 ] );
+ std::vector<sal_uInt8> aSectCLSID(16);
mpSvStream->ReadBytes(mApplicationCLSID, 16);
- mpSvStream->ReadUInt32( nSections );
+ sal_uInt32 nSections(0);
+ mpSvStream->ReadUInt32(nSections);
if ( nSections > 2 ) // sj: PowerPoint documents are containing max 2 sections
{
mbStatus = false;
}
else for ( sal_uInt32 i = 0; i < nSections; i++ )
{
- mpSvStream->ReadBytes(pSectCLSID.get(), 16);
+ mpSvStream->ReadBytes(aSectCLSID.data(), aSectCLSID.size());
+ sal_uInt32 nSectionOfs(0);
mpSvStream->ReadUInt32( nSectionOfs );
- nCurrent = mpSvStream->Tell();
+ sal_uInt32 nCurrent = mpSvStream->Tell();
mpSvStream->Seek( nSectionOfs );
- Section aSection( pSectCLSID.get() );
+ Section aSection(aSectCLSID.data());
aSection.Read( mpSvStream.get() );
maSections.push_back( o3tl::make_unique<Section>( aSection ) );
mpSvStream->Seek( nCurrent );