From e3c14419f6a74de8be5b5d3c7e9bc567b190f241 Mon Sep 17 00:00:00 2001 From: emoose Date: Sun, 6 Jun 2021 06:47:39 +0100 Subject: [PATCH] [CPU/XEX] Use correct size for XEXP-patched header buffer --- src/xenia/cpu/xex_module.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/xenia/cpu/xex_module.cc b/src/xenia/cpu/xex_module.cc index 8caeec5af..70861aa7e 100644 --- a/src/xenia/cpu/xex_module.cc +++ b/src/xenia/cpu/xex_module.cc @@ -249,12 +249,11 @@ int XexModule::ApplyPatch(XexModule* module) { // Patch base XEX header uint32_t original_image_size = module->image_size(); - uint32_t header_target_size = patch_header->delta_headers_target_offset + - patch_header->delta_headers_source_size; + uint32_t header_target_size = patch_header->size_of_target_headers; if (!header_target_size) { - header_target_size = - patch_header->size_of_target_headers; // unsure which is more correct.. + header_target_size = patch_header->delta_headers_target_offset + + patch_header->delta_headers_source_size; } size_t mem_size = module->xex_header_mem_.size();