mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
3rdParty: add bounds checking to cart_rom.c in mupen64plus-core
This commit is contained in:
@@ -63,9 +63,13 @@ void read_cart_rom(void* opaque, uint32_t address, uint32_t* value)
|
||||
{
|
||||
*value = cart_rom->last_write;
|
||||
}
|
||||
else if (addr < cart_rom->rom_size)
|
||||
{
|
||||
*value = *(uint32_t*)(cart_rom->rom + addr);
|
||||
}
|
||||
else
|
||||
{
|
||||
*value = cart_rom->rom_size == 0 ? 0 : *(uint32_t*)(cart_rom->rom + addr);
|
||||
*value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user