From c11711681f49b7e975c8edd70eec2e49600daa57 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 18 Jan 2014 23:20:32 -0800 Subject: [PATCH] Actually fixing STFS. --- src/xenia/kernel/fs/devices/stfs_container_file.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/fs/devices/stfs_container_file.cc b/src/xenia/kernel/fs/devices/stfs_container_file.cc index 80509b692..0b2433948 100644 --- a/src/xenia/kernel/fs/devices/stfs_container_file.cc +++ b/src/xenia/kernel/fs/devices/stfs_container_file.cc @@ -58,10 +58,11 @@ X_STATUS STFSContainerFile::ReadSync( for (size_t n = start_block; n < end_block; n++) { auto& record = stfs_entry->block_list[n]; size_t offset = record.offset; + size_t read_length = MIN(remaining_length, record.length); if (n == start_block) { offset += byte_offset % 4096; + read_length = MIN(read_length, record.length - (byte_offset % 4096)); } - size_t read_length = MIN(remaining_length, record.length); xe_copy_struct(dest_ptr, map_ptr + offset, read_length); dest_ptr += read_length; remaining_length -= read_length;