diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-10-05 15:04:10 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-10-05 15:12:51 +0200 |
commit | e8f7b79bb00870a6c6b64f81f9a6d7ecea50d823 (patch) | |
tree | 1d0af7fef3e24ebf392abfff531121d5ad13b142 /core/io | |
parent | d9af98e114201aba61e8e237a8d0bdea4029cf71 (diff) |
[File] Fix FileAccessCompressed::get_buffer return value.
It used to return the write index instead of the written bytes (i.e.
index + 1) when reading until last block.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/file_access_compressed.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index e54c947340..6b9e3298fd 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -312,10 +312,10 @@ uint64_t FileAccessCompressed::get_buffer(uint8_t *p_dst, uint64_t p_length) con } else { read_block--; at_end = true; - if (i < p_length - 1) { + if (i + 1 < p_length) { read_eof = true; } - return i; + return i + 1; } } } |