Kaydet (Commit) bcdaaf62 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#115750 SvStream::WriteStream was broken

and didn't stop copying at the size limit arg

Change-Id: I8f1be0310160f5158d2f64c62d6b2c09c0157930
Reviewed-on: https://gerrit.libreoffice.org/49838Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 261d422d
......@@ -1186,13 +1186,12 @@ sal_uInt64 SvStream::WriteStream( SvStream& rStream, sal_uInt64 nSize )
sal_uInt32 nCount;
sal_uInt64 nWriteSize = nSize;
do {
if ( nSize >= nCurBufLen )
nWriteSize -= nCurBufLen;
else
nCurBufLen = nWriteSize;
nCount = rStream.ReadBytes( pBuf.get(), nCurBufLen );
do
{
nCurBufLen = std::min<sal_uInt64>(nCurBufLen, nWriteSize);
nCount = rStream.ReadBytes(pBuf.get(), nCurBufLen);
WriteBytes( pBuf.get(), nCount );
nWriteSize -= nCount;
}
while( nWriteSize && nCount == nCurBufLen );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment