diff options
author | bunnei <bunneidev@gmail.com> | 2022-04-06 03:18:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-06 03:18:41 +0200 |
commit | 0c1b954e072f8b82bf17ada3ca50e725bda6e27a (patch) | |
tree | b794be8017f0904ce16b695ad4102e975fe17492 /src/core/file_sys | |
parent | Merge pull request #8159 from merryhime/pst (diff) | |
parent | registered_cache: Prevent nullptr dereference when accumulating files (diff) | |
download | yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.tar yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.tar.gz yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.tar.bz2 yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.tar.lz yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.tar.xz yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.tar.zst yuzu-0c1b954e072f8b82bf17ada3ca50e725bda6e27a.zip |
Diffstat (limited to 'src/core/file_sys')
-rw-r--r-- | src/core/file_sys/registered_cache.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 7a646b5f1..4ada4a69b 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -387,15 +387,17 @@ std::vector<NcaID> RegisteredCache::AccumulateFiles() const { continue; for (const auto& nca_dir : d2_dir->GetSubdirectories()) { - if (!FollowsNcaIdFormat(nca_dir->GetName())) + if (nca_dir == nullptr || !FollowsNcaIdFormat(nca_dir->GetName())) { continue; + } ids.push_back(Common::HexStringToArray<0x10, true>(nca_dir->GetName().substr(0, 0x20))); } for (const auto& nca_file : d2_dir->GetFiles()) { - if (!FollowsNcaIdFormat(nca_file->GetName())) + if (nca_file == nullptr || !FollowsNcaIdFormat(nca_file->GetName())) { continue; + } ids.push_back( Common::HexStringToArray<0x10, true>(nca_file->GetName().substr(0, 0x20))); |