summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-17 10:26:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-17 11:22:12 +0100
commit6a1f31898d4d44d69f4f65e56f5dd087607885af (patch)
tree3cd951c2b298c2c15039fddb47ad798d9740c491 /tools
parentc9ba7a2a4d29af2542f31562cfdd64db2237aea8 (diff)
in remainingSize consider that its is possible to seek past the end
Change-Id: I1652244d5515629f1cd8f15f4c5b15f139dba0aa
Diffstat (limited to 'tools')
-rw-r--r--tools/source/stream/stream.cxx2
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;
}