aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/script.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-30 16:14:31 +0000
committerFilippos Karapetis2010-05-30 16:14:31 +0000
commitc32e88fe0bb61e75ca983072ba28102d4efbf123 (patch)
tree1da8c37a9256743e2c62abc8d3a70d84c26e8e55 /engines/sci/engine/script.cpp
parent0276ec835ef3c77a4dbf772ea54cc6d5292452f2 (diff)
downloadscummvm-rg350-c32e88fe0bb61e75ca983072ba28102d4efbf123.tar.gz
scummvm-rg350-c32e88fe0bb61e75ca983072ba28102d4efbf123.tar.bz2
scummvm-rg350-c32e88fe0bb61e75ca983072ba28102d4efbf123.zip
Limit access to the _bufSize, _scriptSize and _heapSize members of the Script class
svn-id: r49327
Diffstat (limited to 'engines/sci/engine/script.cpp')
-rw-r--r--engines/sci/engine/script.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 051cb0d215..ab0ab69083 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -175,7 +175,7 @@ void SegManager::scriptInitialiseLocals(reg_t location) {
Script *scr = getScript(location.segment);
unsigned int count;
- VERIFY(location.offset + 1 < (uint16)scr->_bufSize, "Locals beyond end of script\n");
+ VERIFY(location.offset + 1 < (uint16)scr->getBufSize(), "Locals beyond end of script\n");
if (getSciVersion() >= SCI_VERSION_1_1)
count = READ_SCI11ENDIAN_UINT16(scr->_buf + location.offset - 2);
@@ -185,9 +185,9 @@ void SegManager::scriptInitialiseLocals(reg_t location) {
scr->_localsOffset = location.offset;
- if (!(location.offset + count * 2 + 1 < scr->_bufSize)) {
- warning("Locals extend beyond end of script: offset %04x, count %x vs size %x", location.offset, count, (uint)scr->_bufSize);
- count = (scr->_bufSize - location.offset) >> 1;
+ if (!(location.offset + count * 2 + 1 < scr->getBufSize())) {
+ warning("Locals extend beyond end of script: offset %04x, count %x vs size %x", location.offset, count, (uint)scr->getBufSize());
+ count = (scr->getBufSize() - location.offset) >> 1;
}
LocalVariables *locals = allocLocalsSegment(scr, count);