From f7032f8debafcb1f7fe4ad87df9b0b89d28c02a3 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 1 Aug 2017 19:57:06 +0200 Subject: [PATCH] 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. --- Source/Core/DiscIO/FileSystemGCWii.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 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); + } } }