summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-07-19 18:40:06 +0200
committerLioncash <mathew1800@gmail.com>2018-07-19 18:43:21 +0200
commit9b22f856c2f644af721568a6f6b23bd66e7beb93 (patch)
tree841c4a2ad026152dcf1571f3bab77860567da796
parentMerge pull request #699 from lioncash/vfs (diff)
downloadyuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.tar
yuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.tar.gz
yuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.tar.bz2
yuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.tar.lz
yuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.tar.xz
yuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.tar.zst
yuzu-9b22f856c2f644af721568a6f6b23bd66e7beb93.zip
-rw-r--r--src/core/loader/nso.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index 2beb85fbf..59049d016 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -55,13 +55,15 @@ AppLoader_NSO::AppLoader_NSO(FileSys::VirtualFile file) : AppLoader(std::move(fi
FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) {
u32 magic = 0;
- file->ReadObject(&magic);
+ if (file->ReadObject(&magic) != sizeof(magic)) {
+ return FileType::Error;
+ }
- if (Common::MakeMagic('N', 'S', 'O', '0') == magic) {
- return FileType::NSO;
+ if (Common::MakeMagic('N', 'S', 'O', '0') != magic) {
+ return FileType::Error;
}
- return FileType::Error;
+ return FileType::NSO;
}
static std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data,