sfx2/source/doc/oleprops.cxx | 17 ++++++++++------- sw/qa/core/data/ww8/pass/hang-4.doc |binary 2 files changed, 10 insertions(+), 7 deletions(-)
New commits: commit 9f095c4107f46cad85c0b7e160f6e05a9e17c211 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Aug 19 20:46:16 2015 +0100 it's no use to check for stream status after a seek seek resets failures, need to check after a read and before a seek Change-Id: Ia249e258c51af5efc838f92c4ead6237b403c701 (cherry picked from commit 170ff56b1b99ec451e9adbc9ae9c2a94dd47a692) Reviewed-on: https://gerrit.libreoffice.org/17867 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 9516e31..5857b6e 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 new file mode 100644 index 0000000..b7fd040 Binary files /dev/null and b/sw/qa/core/data/ww8/pass/hang-4.doc differ
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits