Kaydet (Commit) 1b40966f authored tarafından Michael Stahl's avatar Michael Stahl

sot: fix some bizarre resize code that creates 4G temp files on 32bit

StgTmpStrm::SetSize(): the nEndOfData - 1 may underflow if nEndOfData=0
which happened to be the same value of STREAM_SEEK_TO_END before
but not any more; also it's a mystery to me why the last byte in the
buffer would need to be overwritten with 0 here.

This also fixes the failure of ww8_export test.

Change-Id: Iefe5a22c667ee83fbc315d772f357b913105ad93
üst 383c7a69
...@@ -1241,10 +1241,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) ...@@ -1241,10 +1241,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
{ {
if( n > nEndOfData ) if( n > nEndOfData )
{ {
sal_uInt64 nCur = Tell(); SvMemoryStream::SetSize(n);
Seek( nEndOfData - 1 );
WriteUChar( (sal_uInt8) 0 );
Seek( nCur );
} }
else else
nEndOfData = n; nEndOfData = n;
......
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