diff options
-rw-r--r-- | sfx2/source/doc/oleprops.cxx | 17 | ||||
-rw-r--r-- | sw/qa/core/data/ww8/pass/hang-4.doc | bin | 0 -> 10240 bytes |
2 files changed, 10 insertions, 7 deletions
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 055355b4b675..6552c9e1edef 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -1226,19 +1226,22 @@ void SfxOlePropertySet::ImplLoad( SvStream& rStrm ) // read sections sal_Size nSectPosPos = rStrm.Tell(); - for( sal_Int32 nSectIdx = 0; (nSectIdx < nSectCount) && (rStrm.GetErrorCode() == SVSTREAM_OK) && !rStrm.IsEof(); ++nSectIdx ) + for (sal_Int32 nSectIdx = 0; nSectIdx < nSectCount; ++nSectIdx) { // read section guid/position pair - rStrm.Seek( nSectPosPos ); + rStrm.Seek(nSectPosPos); SvGlobalName aSectGuid; - sal_uInt32 nSectPos; rStrm >> aSectGuid; - rStrm.ReadUInt32( nSectPos ); + sal_uInt32 nSectPos(0); + rStrm.ReadUInt32(nSectPos); + if (!rStrm.good()) + break; nSectPosPos = rStrm.Tell(); // read section - rStrm.Seek( static_cast< sal_Size >( nSectPos ) ); - if( rStrm.GetErrorCode() == SVSTREAM_OK ) - LoadObject( rStrm, AddSection( aSectGuid ) ); + rStrm.Seek(nSectPos); + LoadObject(rStrm, AddSection(aSectGuid)); + if (!rStrm.good()) + break; } } diff --git a/sw/qa/core/data/ww8/pass/hang-4.doc b/sw/qa/core/data/ww8/pass/hang-4.doc Binary files differnew file mode 100644 index 000000000000..b7fd04012f9a --- /dev/null +++ b/sw/qa/core/data/ww8/pass/hang-4.doc |