diff options
| author | JosJuice <josjuice@gmail.com> | 2017-08-01 19:57:06 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-08-01 21:58:25 +0200 |
| commit | f7032f8debafcb1f7fe4ad87df9b0b89d28c02a3 (patch) | |
| tree | bafdc455116dd40fdc50e061ad227148a6c67b05 /Source/Core/DiscIO/FileSystemGCWii.cpp | |
| parent | b155c46aca55b18053bc9a8a83893b87d0dcb1fb (diff) | |
FileSystemGCWii: Don't add 0-size files to m_offset_file_info_cache
This is done in order to reduce the risk of files not being added
due to them having the same end offset as another file.
Diffstat (limited to 'Source/Core/DiscIO/FileSystemGCWii.cpp')
| -rw-r--r-- | Source/Core/DiscIO/FileSystemGCWii.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/FileSystemGCWii.cpp b/Source/Core/DiscIO/FileSystemGCWii.cpp index 9a7e24c288..4e2132654b 100644 --- a/Source/Core/DiscIO/FileSystemGCWii.cpp +++ b/Source/Core/DiscIO/FileSystemGCWii.cpp @@ -308,7 +308,11 @@ std::unique_ptr<FileInfo> FileSystemGCWii::FindFileInfo(u64 disc_offset) const { FileInfoGCWii file_info(m_root, i); if (!file_info.IsDirectory()) - m_offset_file_info_cache.emplace(file_info.GetOffset() + file_info.GetSize(), i); + { + const u32 size = file_info.GetSize(); + if (size != 0) + m_offset_file_info_cache.emplace(file_info.GetOffset() + size, i); + } } } |
