diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-17 10:26:46 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:56:30 +0200 |
commit | 07bedabbff9a54fb9b1553ac1cca2751a02b3b33 (patch) | |
tree | 8687fd13a5ab8093e5ab3827d98b72f1625bb2b6 /tools | |
parent | e5d8a9d123052eaf5556a52948f855fa478bd6db (diff) |
in remainingSize consider that its is possible to seek past the end
Change-Id: I1652244d5515629f1cd8f15f4c5b15f139dba0aa
(cherry picked from commit 6a1f31898d4d44d69f4f65e56f5dd087607885af)
Reviewed-on: https://gerrit.libreoffice.org/17158
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'tools')
-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 002d9e5e5fbb..bb6d21e1a92a 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1464,7 +1464,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; } |