diff --git a/src/xenia/cpu/export_resolver.cc b/src/xenia/cpu/export_resolver.cc index 68028e7a2..9b500caee 100644 --- a/src/xenia/cpu/export_resolver.cc +++ b/src/xenia/cpu/export_resolver.cc @@ -63,7 +63,7 @@ Export* ExportResolver::GetExportByOrdinal(const char* module_name, for (const auto& table : tables_) { if (std::strncmp(module_name, table.module_name(), std::strlen(table.module_name())) == 0) { - if (ordinal > table.exports_by_ordinal().size()) { + if (ordinal >= table.exports_by_ordinal().size()) { return nullptr; } return table.exports_by_ordinal().at(ordinal); diff --git a/src/xenia/cpu/xex_module.cc b/src/xenia/cpu/xex_module.cc index e842b58b4..53a92e25c 100644 --- a/src/xenia/cpu/xex_module.cc +++ b/src/xenia/cpu/xex_module.cc @@ -126,7 +126,7 @@ uint32_t XexModule::GetProcAddress(uint16_t ordinal) const { xex_security_info()->export_table); ordinal -= export_table->base; - if (ordinal > export_table->count) { + if (ordinal >= export_table->count) { XELOGE("GetProcAddress(%.3X): ordinal out of bounds", ordinal); return 0; }