Skip to content

Commit

Permalink
FileSystemGCWii: Don't add 0-size files to m_offset_file_info_cache
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JosJuice committed Aug 1, 2017
1 parent c2cd8d2 commit da25967
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Core/DiscIO/FileSystemGCWii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit da25967

Please sign in to comment.