Fixed rare crash when accessing library import by name
The library name index may only be 8-bits.
This bug was not present in the previous implementation due to a bitmask
(0xFF) - see
ea99ba8e3b/src/xenia/kernel/util/xex2.cc (L272)
This commit is contained in:
@@ -475,10 +475,11 @@ void UserModule::Dump() {
|
||||
reinterpret_cast<const uint8_t*>(opt_import_libraries) +
|
||||
opt_import_libraries->string_table_size + 12;
|
||||
uint32_t library_offset = 0;
|
||||
for (uint32_t l = 0; l < opt_import_libraries->library_count; l++) {
|
||||
uint32_t library_count = opt_import_libraries->library_count;
|
||||
for (uint32_t l = 0; l < library_count; l++) {
|
||||
auto library = reinterpret_cast<const xex2_import_library*>(
|
||||
libraries + library_offset);
|
||||
auto name = string_table[library->name_index];
|
||||
auto name = string_table[library->name_index % library_count];
|
||||
sb.AppendFormat(" %s - %d imports\n", name,
|
||||
(uint16_t)library->count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user