aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/HexInStream.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rdr/HexInStream.cxx')
-rw-r--r--common/rdr/HexInStream.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rdr/HexInStream.cxx b/common/rdr/HexInStream.cxx
index a6bc92cd..787edc04 100644
--- a/common/rdr/HexInStream.cxx
+++ b/common/rdr/HexInStream.cxx
@@ -91,7 +91,7 @@ size_t HexInStream::overrun(size_t itemSize, size_t nItems, bool wait) {
offset += ptr - start;
ptr = start;
- while ((size_t)(end - ptr) < itemSize) {
+ while (avail() < itemSize) {
size_t n = in_stream.check(2, 1, wait);
if (n == 0) return 0;
const U8* iptr = in_stream.getptr();
@@ -111,7 +111,7 @@ size_t HexInStream::overrun(size_t itemSize, size_t nItems, bool wait) {
}
size_t nAvail;
- nAvail = (end - ptr) / itemSize;
+ nAvail = avail() / itemSize;
if (nAvail < nItems)
return nAvail;