diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/segment.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 991a56a8cf..4b4ce491e5 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -264,10 +264,12 @@ SegmentRef LocalVariables::dereference(reg_t pointer) { SegmentRef ret; ret.isRaw = false; // reg_t based data! ret.maxSize = (_locals.size() - pointer.offset/2) * 2; - if (ret.maxSize > 0) + if (ret.maxSize > 0) { ret.raw = (byte *)&_locals[pointer.offset/2]; - else + } else { warning("LocalVariables::dereference: Offset at end or out of bounds %04x:%04x", PRINT_REG(pointer)); + ret.raw = 0; + } return ret; } |