summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-26 14:26:40 +0100
committerDavid Tardon <dtardon@redhat.com>2015-08-26 15:34:02 +0000
commit0b0b2531fc56c7a58835c9242d16c64cce5a3dd2 (patch)
tree4a9bd6bbe505c0cf5266a6278f939788ce17a90e /sd
parentaa9a5f6c7f4fb2edce07ad42c3937ea66893b611 (diff)
various hangs, check seeks and record lengths
Change-Id: Ided7f9376f41ee8cb1f6903e54a2d51e0e07e1a7 (cherry picked from commit a8b2dc80c41022515c3a1df6f7ea245c3390dc39) Reviewed-on: https://gerrit.libreoffice.org/18024 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/ppt/pass/hang-2.pptbin0 -> 7680 bytes
-rw-r--r--sd/source/filter/ppt/propread.cxx6
2 files changed, 4 insertions, 2 deletions
diff --git a/sd/qa/unit/data/ppt/pass/hang-2.ppt b/sd/qa/unit/data/ppt/pass/hang-2.ppt
new file mode 100644
index 000000000000..c6880b771dfc
--- /dev/null
+++ b/sd/qa/unit/data/ppt/pass/hang-2.ppt
Binary files differ
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index e2864220ca63..374ecbb0e8be 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -306,7 +306,7 @@ bool Section::GetDictionary( Dictionary& rDict )
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();
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -314,9 +314,11 @@ void Section::Read( SotStorageStream *pStrm )
pStrm->Seek( nSecOfs );
mnTextEnc = RTL_TEXTENCODING_MS_1252;
+ sal_uInt32 nSecSize(0), nPropCount(0);
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 );
nCurrent = pStrm->Tell();
pStrm->Seek( nPropOfs + nSecOfs );