From 01dda1948a42836d74c656820b008a1534460fa6 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Wed, 9 Aug 2023 00:01:10 +0200 Subject: [PATCH] early-access version 3798 --- README.md | 2 +- .../hle/service/filesystem/filesystem.cpp | 28 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dbb5e36e3..e6a024107 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3797. +This is the source code for early-access 3798. ## Legal Notice diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 86025f02e..fd312f444 100755 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -383,7 +383,12 @@ Result FileSystemController::CreateSaveData(FileSys::VirtualDir* out_save_data, return FileSys::ERROR_ENTITY_NOT_FOUND; } - *out_save_data = save_data_factory->Create(space, save_struct); + auto save_data = save_data_factory->Create(space, save_struct); + if (save_data == nullptr) { + return FileSys::ERROR_ENTITY_NOT_FOUND; + } + + *out_save_data = save_data; return ResultSuccess; } @@ -397,7 +402,12 @@ Result FileSystemController::OpenSaveData(FileSys::VirtualDir* out_save_data, return FileSys::ERROR_ENTITY_NOT_FOUND; } - *out_save_data = save_data_factory->Open(space, attribute); + auto save_data = save_data_factory->Open(space, attribute); + if (save_data == nullptr) { + return FileSys::ERROR_ENTITY_NOT_FOUND; + } + + *out_save_data = save_data; return ResultSuccess; } @@ -409,7 +419,12 @@ Result FileSystemController::OpenSaveDataSpace(FileSys::VirtualDir* out_save_dat return FileSys::ERROR_ENTITY_NOT_FOUND; } - *out_save_data_space = save_data_factory->GetSaveDataSpaceDirectory(space); + auto save_data_space = save_data_factory->GetSaveDataSpaceDirectory(space); + if (save_data_space == nullptr) { + return FileSys::ERROR_ENTITY_NOT_FOUND; + } + + *out_save_data_space = save_data_space; return ResultSuccess; } @@ -420,7 +435,12 @@ Result FileSystemController::OpenSDMC(FileSys::VirtualDir* out_sdmc) const { return FileSys::ERROR_SD_CARD_NOT_FOUND; } - *out_sdmc = sdmc_factory->Open(); + auto sdmc = sdmc_factory->Open(); + if (sdmc == nullptr) { + return FileSys::ERROR_SD_CARD_NOT_FOUND; + } + + *out_sdmc = sdmc; return ResultSuccess; }