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 -8
View File
@@ -38,12 +38,6 @@ UtilitiesDialog::UtilitiesDialog(QWidget* parent)
ui->sdDecryptionDisabledLabel->setVisible(!checked);
ui->sdDecryption->setEnabled(checked);
ui->savedataExtractionLabel->setVisible(false);
ui->savedataExtractionDisabledLabel->setVisible(false);
ui->savedataExtractionLabel->setVisible(checked);
ui->savedataExtractionDisabledLabel->setVisible(!checked);
ui->savedataExtraction->setEnabled(checked);
ui->extdataExtractionLabel->setVisible(false);
ui->extdataExtractionDisabledLabel->setVisible(false);
ui->extdataExtractionLabel->setVisible(checked);
@@ -206,7 +200,12 @@ void UtilitiesDialog::SaveDataExtractionTool() {
return false;
}
Core::SDSavegame save(std::move(container.GetIVFCLevel4Data()));
std::vector<std::vector<u8>> container_data;
if (!container.GetIVFCLevel4Data(container_data)) {
return false;
}
Core::SDSavegame save(std::move(container_data));
if (!save.IsGood()) {
return false;
}
@@ -228,7 +227,12 @@ void UtilitiesDialog::SaveDataExtractionTool() {
return false;
}
Core::SDSavegame save(std::move(container.GetIVFCLevel4Data()));
std::vector<std::vector<u8>> container_data;
if (!container.GetIVFCLevel4Data(container_data)) {
return false;
}
Core::SDSavegame save(std::move(container_data));
if (!save.IsGood()) {
return false;
}