Attempt at fixing memory issue on Windows build.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-04-11 15:03:44 +02:00
parent 09c71487be
commit 229850257b
2 changed files with 3 additions and 3 deletions

View File

@@ -41,11 +41,11 @@ public:
int Read(void* ptr, asUINT size) final {
if (size == 0)
return 0;
auto start = reinterpret_cast<uint8_t*>(ptr);
auto toRead = size;
if (_index + toRead > _size) {
if (_index + toRead >= _size) {
toRead = _size - _index;
}
auto start = reinterpret_cast<uint8_t*>(ptr);
for (asUINT index = 0; index < toRead; index++) {
*(start + index) = _out[_index + index];
}