summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-07 05:13:37 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-07 05:13:42 +0200
commit91cfe70301bec23099ae27ad70e3da525a573cfe (patch)
treefa8fbde6661373f7d835f814b09f54f132b99aeb /src/core/file_sys
parentFix missing qjpeg DLL (diff)
downloadyuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.tar
yuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.tar.gz
yuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.tar.bz2
yuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.tar.lz
yuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.tar.xz
yuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.tar.zst
yuzu-91cfe70301bec23099ae27ad70e3da525a573cfe.zip
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/card_image.cpp1
-rw-r--r--src/core/file_sys/content_archive.cpp4
-rw-r--r--src/core/file_sys/content_archive.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp
index 395eea8ae..e897d9913 100644
--- a/src/core/file_sys/card_image.cpp
+++ b/src/core/file_sys/card_image.cpp
@@ -5,6 +5,7 @@
#include <array>
#include <string>
#include <core/loader/loader.h>
+#include "common/logging/log.h"
#include "core/file_sys/card_image.h"
#include "core/file_sys/partition_filesystem.h"
#include "core/file_sys/vfs_offset.h"
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 79e70f6ef..8cd1f5e6a 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -140,6 +140,10 @@ VirtualFile NCA::Decrypt(NCASectionHeader header, VirtualFile in, u64 starting_o
}
NCA::NCA(VirtualFile file_) : file(std::move(file_)) {
+ if (file == nullptr) {
+ status = Loader::ResultStatus::ErrorInvalidFormat;
+ return;
+ }
if (sizeof(NCAHeader) != file->ReadObject(&header))
LOG_ERROR(Loader, "File reader errored out during header read.");
diff --git a/src/core/file_sys/content_archive.h b/src/core/file_sys/content_archive.h
index 6492163b5..a984a4d36 100644
--- a/src/core/file_sys/content_archive.h
+++ b/src/core/file_sys/content_archive.h
@@ -12,6 +12,7 @@
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/swap.h"
+#include "control_metadata.h"
#include "core/crypto/key_manager.h"
#include "core/file_sys/partition_filesystem.h"
#include "core/loader/loader.h"