mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 21:39:54 +00:00
Merge pull request #8552 from rzumer/patch-5
Fix cheevos crash when peeking out of range
This commit is contained in:
commit
ffad99d886
@ -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