aboutsummaryrefslogtreecommitdiff
path: root/engines/simon
diff options
context:
space:
mode:
authorMax Horn2006-08-04 18:58:10 +0000
committerMax Horn2006-08-04 18:58:10 +0000
commit0caaf3fc2c0eff9d54b9dead846665e559135219 (patch)
treed5307d6717e8e9588fc870e8f4cf16e9afb1c9d3 /engines/simon
parentaab45bac44554e0b91c4ca7193e90cbfa1a8b619 (diff)
downloadscummvm-rg350-0caaf3fc2c0eff9d54b9dead846665e559135219.tar.gz
scummvm-rg350-0caaf3fc2c0eff9d54b9dead846665e559135219.tar.bz2
scummvm-rg350-0caaf3fc2c0eff9d54b9dead846665e559135219.zip
Patch #1522592: Bugfix [1498158] SIMON: Itemheap overflow on 64bit systems
svn-id: r23670
Diffstat (limited to 'engines/simon')
-rw-r--r--engines/simon/simon.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index 15f93b3067..70c93c482e 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -654,7 +654,7 @@ void SimonEngine::paletteFadeOut(byte *palPtr, uint num, uint size) {
byte *SimonEngine::allocateItem(uint size) {
byte *org = _itemHeapPtr;
- size = (size + 3) & ~3;
+ size = (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
_itemHeapPtr += size;
_itemHeapCurPos += size;
@@ -727,9 +727,9 @@ Child *SimonEngine::allocateChildBlock(Item *i, uint type, uint size) {
}
void SimonEngine::allocItemHeap() {
- _itemHeapSize = 10000;
+ _itemHeapSize = 20000;
_itemHeapCurPos = 0;
- _itemHeapPtr = (byte *)calloc(10000, 1);
+ _itemHeapPtr = (byte *)calloc(20000, 1);
}
void SimonEngine::allocTablesHeap() {