diff options
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index f7752e0e3..c66561bf4 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 | |||
| 55 | 55 | ||
| 56 | FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) { | 56 | FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) { |
| 57 | u32 magic = 0; | 57 | u32 magic = 0; |
| 58 | file->ReadObject(&magic); | 58 | if (file->ReadObject(&magic) != sizeof(magic)) { |
| 59 | return FileType::Error; | ||
| 60 | } | ||
| 59 | 61 | ||
| 60 | if (Common::MakeMagic('N', 'S', 'O', '0') == magic) { | 62 | if (Common::MakeMagic('N', 'S', 'O', '0') != magic) { |
| 61 | return FileType::NSO; | 63 | return FileType::Error; |
| 62 | } | 64 | } |
| 63 | 65 | ||
| 64 | return FileType::Error; | 66 | return FileType::NSO; |
| 65 | } | 67 | } |
| 66 | 68 | ||
| 67 | static std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data, | 69 | static std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data, |