summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBartłomiej T. Listwon <blistwon@gmail.com>2023-04-07 17:44:38 +0200
committerYuri Sizov <yuris@humnom.net>2023-04-07 17:44:38 +0200
commit1f51ceddf3d9fb8824841023fc43230565189a69 (patch)
tree65c7e469ee0583f9318c4c5216800a06c54317f1 /core
parenteab038693474226599ea7eb168e061672906e444 (diff)
Fix moving position indicator out of bounds in FileAccessMemory
(cherry picked from commit bff0c71e2e2cb9b880181cc819c4753abfe59508)
Diffstat (limited to 'core')
-rw-r--r--core/io/file_access_memory.cpp4
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;
}