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>
This commit is contained in:
Michael Stahl
2019-10-08 16:23:31 +02:00
committed by Michael Stahl
parent 7f791f431c
commit 0c1033a08e

View File

@@ -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");