summaryrefslogtreecommitdiff
path: root/tools/source/stream/stream.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tools/source/stream/stream.cxx')
-rw-r--r--tools/source/stream/stream.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 48cae55f0169..9921d6f8a4dc 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -308,6 +308,8 @@ ErrCode SvAsyncLockBytes::FillAppend(const void * pBuffer, sal_Size nCount,
// virtual
sal_uInt64 SvAsyncLockBytes::Seek(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if (nPos != STREAM_SEEK_TO_END)
m_nSize = nPos;
return m_nSize;
@@ -343,6 +345,8 @@ sal_Size SvStream::PutData( const void* pData, sal_Size nSize )
sal_uInt64 SvStream::SeekPos(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if( !GetError() && nPos == STREAM_SEEK_TO_END )
{
DBG_ASSERT( xLockBytes.Is(), "pure virtual function" );
@@ -1839,6 +1843,8 @@ sal_uInt64 SvMemoryStream::SeekPos(sal_uInt64 const nNewPos)
// nEndOfData: First position in stream not allowed to read from
// nSize: Size of allocated buffer
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nNewPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if( nNewPos < nEndOfData )
nPos = nNewPos;
else if( nNewPos == STREAM_SEEK_TO_END )