diff --git a/src/core/fs/archive_ext_save_data.cpp b/src/core/fs/archive_ext_save_data.cpp index 38de9b5c..6fe4d97c 100644 --- a/src/core/fs/archive_ext_save_data.cpp +++ b/src/core/fs/archive_ext_save_data.cpp @@ -246,7 +246,7 @@ Rust::Result<std::vector<u8>, HorizonResult> ExtSaveDataArchive::loadIcon() cons const fs::path iconPath = IOFile::getAppData() / backingFolder / "icon"; IOFile file(iconPath, "rb"); const s32 size = static_cast<s32>(file.size().value_or(-1)); - if (size < 0) { + if (size <= 0) { return Err(Result::FS::NotFoundInvalid); } diff --git a/src/core/services/fs.cpp b/src/core/services/fs.cpp index 40df67c7..742f1fb1 100644 --- a/src/core/services/fs.cpp +++ b/src/core/services/fs.cpp @@ -578,7 +578,7 @@ void FSService::createExtSaveData(u32 messagePointer) { if (selected != nullptr) { selected->format(path, info); - if (smdhSize > 0) { + if (smdhSize > 0 && smdhPointer != 0) { const FSPath smdh = readPath(PathType::Binary, smdhPointer, smdhSize); selected->saveIcon(smdh.binary); }