mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-03 07:59:38 +00:00
SCI: dont crash when scripts are trying to access invalid memory (fixes intro of lb2cd)
svn-id: r46718
This commit is contained in:
parent
bca313c6fc
commit
3e5d8280fa
@ -264,7 +264,10 @@ SegmentRef LocalVariables::dereference(reg_t pointer) {
|
||||
SegmentRef ret;
|
||||
ret.isRaw = false; // reg_t based data!
|
||||
ret.maxSize = (_locals.size() - pointer.offset/2) * 2;
|
||||
ret.raw = (byte *)&_locals[pointer.offset/2];
|
||||
if (ret.maxSize > 0)
|
||||
ret.raw = (byte *)&_locals[pointer.offset/2];
|
||||
else
|
||||
warning("LocalVariables::dereference: Offset at end or out of bounds %04x:%04x", PRINT_REG(pointer));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user