diff options
| author | 2023-06-19 09:47:05 -0400 | |
|---|---|---|
| committer | 2023-06-19 09:47:05 -0400 | |
| commit | e5f1b22e16b32f36ca3a7af24cbda4f39bc861aa (patch) | |
| tree | 9f3bb5a406a5194e13cf86d85154f45cf78a6d24 | |
| parent | vfs_concat: fix offset calculation when not aligned to file boundary (diff) | |
| download | yuzu-e5f1b22e16b32f36ca3a7af24cbda4f39bc861aa.tar.gz yuzu-e5f1b22e16b32f36ca3a7af24cbda4f39bc861aa.tar.xz yuzu-e5f1b22e16b32f36ca3a7af24cbda4f39bc861aa.zip | |
vfs_concat: verify short read
| -rw-r--r-- | src/core/file_sys/vfs_concat.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/file_sys/vfs_concat.cpp b/src/core/file_sys/vfs_concat.cpp index 5285467d2..311a59e5f 100644 --- a/src/core/file_sys/vfs_concat.cpp +++ b/src/core/file_sys/vfs_concat.cpp | |||
| @@ -168,6 +168,11 @@ std::size_t ConcatenatedVfsFile::Read(u8* data, std::size_t length, std::size_t | |||
| 168 | cur_offset += actual_read_size; | 168 | cur_offset += actual_read_size; |
| 169 | cur_length -= actual_read_size; | 169 | cur_length -= actual_read_size; |
| 170 | it++; | 170 | it++; |
| 171 | |||
| 172 | // If we encountered a short read, we're done. | ||
| 173 | if (actual_read_size < intended_read_size) { | ||
| 174 | break; | ||
| 175 | } | ||
| 171 | } | 176 | } |
| 172 | 177 | ||
| 173 | return cur_offset - offset; | 178 | return cur_offset - offset; |