diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-17 10:26:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-07-17 11:22:12 +0100 |
commit | 6a1f31898d4d44d69f4f65e56f5dd087607885af (patch) | |
tree | 3cd951c2b298c2c15039fddb47ad798d9740c491 /tools/source/stream | |
parent | c9ba7a2a4d29af2542f31562cfdd64db2237aea8 (diff) |
in remainingSize consider that its is possible to seek past the end
Change-Id: I1652244d5515629f1cd8f15f4c5b15f139dba0aa
Diffstat (limited to 'tools/source/stream')
-rw-r--r-- | tools/source/stream/stream.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index c1d21dad9da1..7dd5dd430918 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1453,7 +1453,7 @@ sal_uInt64 SvStream::remainingSize() { sal_uInt64 const nCurr = Tell(); sal_uInt64 const nEnd = Seek(STREAM_SEEK_TO_END); - sal_uInt64 nMaxAvailable = nEnd-nCurr; + sal_uInt64 nMaxAvailable = nEnd > nCurr ? (nEnd-nCurr) : 0; Seek(nCurr); return nMaxAvailable; } |