diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-05 12:03:31 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-05 12:03:31 +0200 |
commit | d985d559bc7366f70ae368b237aa639bf43176b5 (patch) | |
tree | 7614266b38dccec8b36d58c42fb747203b4959b6 /core/io/file_access_memory.cpp | |
parent | b8375071b0633cb96aa633ee00e3878d8ab58703 (diff) | |
parent | bff0c71e2e2cb9b880181cc819c4753abfe59508 (diff) | |
download | redot-engine-d985d559bc7366f70ae368b237aa639bf43176b5.tar.gz |
Merge pull request #75641 from Listwon/fileaccessmemory-buffer-pos
Fix moving position indicator out of bounds in FileAccessMemory
Diffstat (limited to 'core/io/file_access_memory.cpp')
-rw-r--r-- | core/io/file_access_memory.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 1052170f3c..14ec0be092 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -144,7 +144,7 @@ uint64_t FileAccessMemory::get_buffer(uint8_t *p_dst, uint64_t p_length) const { } memcpy(p_dst, &data[pos], read); - pos += p_length; + pos += read; return read; } @@ -172,5 +172,5 @@ void FileAccessMemory::store_buffer(const uint8_t *p_src, uint64_t p_length) { } memcpy(&data[pos], p_src, write); - pos += p_length; + pos += write; } |