Unverified Commit 13d8959f authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #769 from simon-struk/master

Fix overflow in PackedInputStream.
parents 10771d3a 6cd79bec
...@@ -140,7 +140,7 @@ size_t PackedInputStream::tryRead(void* dst, size_t minBytes, size_t maxBytes) { ...@@ -140,7 +140,7 @@ size_t PackedInputStream::tryRead(void* dst, size_t minBytes, size_t maxBytes) {
return out - reinterpret_cast<uint8_t*>(dst); return out - reinterpret_cast<uint8_t*>(dst);
} }
uint inRemaining = BUFFER_REMAINING; size_t inRemaining = BUFFER_REMAINING;
if (inRemaining >= runLength) { if (inRemaining >= runLength) {
// Fast path. // Fast path.
memcpy(out, in, runLength); memcpy(out, in, runLength);
...@@ -266,7 +266,7 @@ void PackedInputStream::skip(size_t bytes) { ...@@ -266,7 +266,7 @@ void PackedInputStream::skip(size_t bytes) {
bytes -= runLength; bytes -= runLength;
uint inRemaining = BUFFER_REMAINING; size_t inRemaining = BUFFER_REMAINING;
if (inRemaining > runLength) { if (inRemaining > runLength) {
// Fast path. // Fast path.
in += runLength; in += runLength;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment