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
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue