diff options
author | Filippos Karapetis | 2010-05-30 16:14:31 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-05-30 16:14:31 +0000 |
commit | c32e88fe0bb61e75ca983072ba28102d4efbf123 (patch) | |
tree | 1da8c37a9256743e2c62abc8d3a70d84c26e8e55 /engines/sci/engine/savegame.cpp | |
parent | 0276ec835ef3c77a4dbf772ea54cc6d5292452f2 (diff) | |
download | scummvm-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/savegame.cpp')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index eb52a888fa..363dc8a44a 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -758,22 +758,22 @@ static void reconstruct_stack(EngineState *retval) { } static void load_script(EngineState *s, Script *scr) { - scr->_buf = (byte *)malloc(scr->_bufSize); + scr->_buf = (byte *)malloc(scr->getBufSize()); assert(scr->_buf); Resource *script = g_sci->getResMan()->findResource(ResourceId(kResourceTypeScript, scr->_nr), 0); assert(script != 0); - assert(scr->_bufSize >= script->size); + assert(scr->getBufSize() >= script->size); memcpy(scr->_buf, script->data, script->size); if (getSciVersion() >= SCI_VERSION_1_1) { Resource *heap = g_sci->getResMan()->findResource(ResourceId(kResourceTypeHeap, scr->_nr), 0); assert(heap != 0); - scr->_heapStart = scr->_buf + scr->_scriptSize; + scr->_heapStart = scr->_buf + scr->getScriptSize(); - assert(scr->_bufSize - scr->_scriptSize <= heap->size); + assert(scr->getBufSize() - scr->getScriptSize() <= heap->size); memcpy(scr->_heapStart, heap->data, heap->size); } } |