mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Fix cheevos crash when peeking out of range
This would occur if the address being peeked at was not part of a memory region defined in the core.
This commit is contained in:
parent
9579804c72
commit
e181bc6d39
@ -527,11 +527,14 @@ static unsigned cheevos_peek(unsigned address, unsigned num_bytes, void* ud)
|
||||
address, cheevos_locals.patchdata.console_id);
|
||||
unsigned value = 0;
|
||||
|
||||
switch (num_bytes)
|
||||
if (data)
|
||||
{
|
||||
case 4: value |= data[2] << 16 | data[3] << 24;
|
||||
case 2: value |= data[1] << 8;
|
||||
case 1: value |= data[0];
|
||||
switch (num_bytes)
|
||||
{
|
||||
case 4: value |= data[2] << 16 | data[3] << 24;
|
||||
case 2: value |= data[1] << 8;
|
||||
case 1: value |= data[0];
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user