aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhttp')
-rw-r--r--src/zenhttp/httpclient.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index f2b26b922..a2d323b5e 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -333,7 +333,7 @@ namespace detail {
m_Buffer = (uint8_t*)Memory::Alloc(gsl::narrow<size_t>(m_BufferSize));
}
m_BufferStart = Begin;
- m_BufferEnd = Min(Begin + m_BufferSize, m_FileSize);
+ m_BufferEnd = Min(Begin + m_BufferSize, m_FileEnd);
Read(m_Buffer, m_BufferEnd - m_BufferStart, m_BufferStart);
uint64_t Count = Min(m_BufferEnd, End) - m_BufferStart;
memcpy(WritePtr + Begin - m_FileOffset, m_Buffer, Count);