Add proper error handling for memcpy

This commit is contained in:
zhupengfei
2020-05-16 19:09:50 +08:00
parent 6be3fca2de
commit 57a1245e2a
6 changed files with 203 additions and 90 deletions
+12 -2
View File
@@ -164,7 +164,12 @@ bool SDMCImporter::ImportSavegame(u64 id, [[maybe_unused]] const ProgressCallbac
return false;
}
SDSavegame save(std::move(container.GetIVFCLevel4Data()));
std::vector<std::vector<u8>> container_data;
if (!container.GetIVFCLevel4Data(container_data)) {
return false;
}
SDSavegame save(std::move(container_data));
if (!save.IsGood()) {
return false;
}
@@ -329,7 +334,12 @@ bool SDMCImporter::ImportSysdata(u64 id, [[maybe_unused]] const ProgressCallback
return false;
}
SDSavegame save(std::move(container.GetIVFCLevel4Data()));
std::vector<std::vector<u8>> container_data;
if (!container.GetIVFCLevel4Data(container_data)) {
return false;
}
SDSavegame save(std::move(container_data));
if (!save.IsGood()) {
return false;
}