diff options
Diffstat (limited to 'engines/gob/script.cpp')
-rw-r--r-- | engines/gob/script.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp index 50a21014de..abcc4511b3 100644 --- a/engines/gob/script.cpp +++ b/engines/gob/script.cpp @@ -123,9 +123,21 @@ int32 Script::getOffset(byte *ptr) { if (!_totData) return -1; + if ((ptr < _totData) || (ptr >= (_totData + _totSize))) + return -1; + return ptr - _totData; } +byte *Script::getData(int32 offset) { + if (!_totData) + return 0; + if ((offset < 0) || (((uint32) offset) >= _totSize)) + return 0; + + return _totData + offset; +} + byte *Script::getData() { return _totData; } |