diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-08-10 03:06:44 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-10 03:06:59 +0200 |
commit | ec3bef7b4c21931918f3a84ad79a53d31b02aeaf (patch) | |
tree | e9da97be14d9474910faa1cfde851aa5b2383bc0 /src/core/file_sys/program_metadata.cpp | |
parent | Merge pull request #995 from bunnei/gl-buff-bounds (diff) | |
download | yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.gz yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.bz2 yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.lz yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.xz yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.tar.zst yuzu-ec3bef7b4c21931918f3a84ad79a53d31b02aeaf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/program_metadata.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 63d4b6e4f..279f987d4 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp @@ -12,26 +12,26 @@ namespace FileSys { Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) { size_t total_size = static_cast<size_t>(file->GetSize()); if (total_size < sizeof(Header)) - return Loader::ResultStatus::Error; + return Loader::ResultStatus::ErrorBadNPDMHeader; // TODO(DarkLordZach): Use ReadObject when Header/AcidHeader becomes trivially copyable. std::vector<u8> npdm_header_data = file->ReadBytes(sizeof(Header)); if (sizeof(Header) != npdm_header_data.size()) - return Loader::ResultStatus::Error; + return Loader::ResultStatus::ErrorBadNPDMHeader; std::memcpy(&npdm_header, npdm_header_data.data(), sizeof(Header)); std::vector<u8> acid_header_data = file->ReadBytes(sizeof(AcidHeader), npdm_header.acid_offset); if (sizeof(AcidHeader) != acid_header_data.size()) - return Loader::ResultStatus::Error; + return Loader::ResultStatus::ErrorBadACIDHeader; std::memcpy(&acid_header, acid_header_data.data(), sizeof(AcidHeader)); if (sizeof(AciHeader) != file->ReadObject(&aci_header, npdm_header.aci_offset)) - return Loader::ResultStatus::Error; + return Loader::ResultStatus::ErrorBadACIHeader; if (sizeof(FileAccessControl) != file->ReadObject(&acid_file_access, acid_header.fac_offset)) - return Loader::ResultStatus::Error; + return Loader::ResultStatus::ErrorBadFileAccessControl; if (sizeof(FileAccessHeader) != file->ReadObject(&aci_file_access, aci_header.fah_offset)) - return Loader::ResultStatus::Error; + return Loader::ResultStatus::ErrorBadFileAccessHeader; return Loader::ResultStatus::Success; } |