Kaydet (Commit) 0b0b2531 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) David Tardon

various hangs, check seeks and record lengths

Change-Id: Ided7f9376f41ee8cb1f6903e54a2d51e0e07e1a7
(cherry picked from commit a8b2dc80)
Reviewed-on: https://gerrit.libreoffice.org/18024Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst aa9a5f6c
...@@ -306,7 +306,7 @@ bool Section::GetDictionary( Dictionary& rDict ) ...@@ -306,7 +306,7 @@ bool Section::GetDictionary( Dictionary& rDict )
void Section::Read( SotStorageStream *pStrm ) void Section::Read( SotStorageStream *pStrm )
{ {
sal_uInt32 i, nSecOfs, nSecSize, nPropCount, nPropId, nPropOfs, nPropType, nPropSize, nCurrent, nVectorCount, nTemp, nStrmSize; sal_uInt32 i, nSecOfs, nPropType, nPropSize, nCurrent, nVectorCount, nTemp, nStrmSize;
nSecOfs = pStrm->Tell(); nSecOfs = pStrm->Tell();
pStrm->Seek( STREAM_SEEK_TO_END ); pStrm->Seek( STREAM_SEEK_TO_END );
...@@ -314,9 +314,11 @@ void Section::Read( SotStorageStream *pStrm ) ...@@ -314,9 +314,11 @@ void Section::Read( SotStorageStream *pStrm )
pStrm->Seek( nSecOfs ); pStrm->Seek( nSecOfs );
mnTextEnc = RTL_TEXTENCODING_MS_1252; mnTextEnc = RTL_TEXTENCODING_MS_1252;
sal_uInt32 nSecSize(0), nPropCount(0);
pStrm->ReadUInt32( nSecSize ).ReadUInt32( nPropCount ); pStrm->ReadUInt32( nSecSize ).ReadUInt32( nPropCount );
while( nPropCount-- && ( pStrm->GetError() == ERRCODE_NONE ) ) while (nPropCount-- && pStrm->good())
{ {
sal_uInt32 nPropId(0), nPropOfs(0);
pStrm->ReadUInt32( nPropId ).ReadUInt32( nPropOfs ); pStrm->ReadUInt32( nPropId ).ReadUInt32( nPropOfs );
nCurrent = pStrm->Tell(); nCurrent = pStrm->Tell();
pStrm->Seek( nPropOfs + nSecOfs ); pStrm->Seek( nPropOfs + nSecOfs );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment