From aca624ef9cb8ce48f0c8884884da5a56165b277b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 20 Aug 2022 21:18:36 +0200 Subject: [PATCH] DiscIO: Fix calculation of NFS raw size --- Source/Core/DiscIO/NFSBlob.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/DiscIO/NFSBlob.cpp b/Source/Core/DiscIO/NFSBlob.cpp index da558361da..680051be60 100644 --- a/Source/Core/DiscIO/NFSBlob.cpp +++ b/Source/Core/DiscIO/NFSBlob.cpp @@ -76,7 +76,7 @@ std::vector NFSFileReader::OpenFiles(const std::string& directory, std::vector files; files.reserve(file_count); - u64 raw_size = first_file.GetSize(); + *raw_size_out = first_file.GetSize(); files.emplace_back(std::move(first_file)); for (u64 i = 1; i < file_count; ++i) @@ -89,16 +89,16 @@ std::vector NFSFileReader::OpenFiles(const std::string& directory, return {}; } - raw_size += child.GetSize(); + *raw_size_out += child.GetSize(); files.emplace_back(std::move(child)); } - if (raw_size < expected_raw_size) + if (*raw_size_out < expected_raw_size) { ERROR_LOG_FMT( DISCIO, "Expected sum of NFS file sizes for {} to be at least {} bytes, but it was {} bytes", - directory, expected_raw_size, raw_size); + directory, expected_raw_size, *raw_size_out); return {}; }