diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-08 16:23:31 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-09 15:28:49 +0200 |
commit | 0c1033a08eff36699d4ec1e8eea76a7d8b621cdf (patch) | |
tree | ec11eee2f23a9b84d1dfb132e6d04e7e363db9f7 /tools | |
parent | 7f791f431c79c6d0a156c4a2726a0dfc5ff40cc1 (diff) |
tools: don't leave SvStream::m_nBufFilePos pointing beyond the end
... of the stream in SvStream::SetStreamSize(); this caused
SvMemoryStream with SetStreamSize(0) and subsequent write to be
pre-filled with 0 bytes.
Change-Id: I0de704b319f5087bc6c1914881e38018212afbf2
Reviewed-on: https://gerrit.libreoffice.org/80478
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/stream/stream.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index a793446ce738..713d36504b6f 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1561,6 +1561,10 @@ bool SvStream::SetStreamSize(sal_uInt64 const nSize) sal_uInt16 nBuf = m_nBufSize; SetBufferSize( 0 ); SetSize( nSize ); + if (nSize < m_nBufFilePos) + { + m_nBufFilePos = nSize; + } SetBufferSize( nBuf ); #ifdef DBG_UTIL DBG_ASSERT(Tell()==nFPos,"SetStreamSize failed"); |