chore: add error checking to ApplyPatchToROM

This commit is contained in:
Justin Scofield
2022-08-07 13:46:44 -04:00
parent b510ad3fc6
commit 713edac333

View File

@@ -64,6 +64,10 @@ std::string GenerateBytePool(char mosaic_tiles[core::kNumOverworldMaps]) {
}
absl::Status Script::ApplyPatchToROM(ROM &rom) {
if (patch_contents_.empty() || patch_filename_.empty()) {
return absl::InvalidArgumentError("No patch loaded!");
}
char *data = (char *)rom.data();
int size = rom.GetSize();
int count = 0;