[Scummvm-cvs-logs] SF.net SVN: scummvm: [23670] scummvm/trunk/engines/simon/simon.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Aug 4 20:58:15 CEST 2006


Revision: 23670
Author:   fingolfin
Date:     2006-08-04 11:58:10 -0700 (Fri, 04 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23670&view=rev

Log Message:
-----------
Patch #1522592: Bugfix [1498158] SIMON: Itemheap overflow on 64bit systems

Modified Paths:
--------------
    scummvm/trunk/engines/simon/simon.cpp
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-08-04 18:11:00 UTC (rev 23669)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-08-04 18:58:10 UTC (rev 23670)
@@ -654,7 +654,7 @@
 
 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 @@
 }
 
 void SimonEngine::allocItemHeap() {
-	_itemHeapSize = 10000;
+	_itemHeapSize = 20000;
 	_itemHeapCurPos = 0;
-	_itemHeapPtr = (byte *)calloc(10000, 1);
+	_itemHeapPtr = (byte *)calloc(20000, 1);
 }
 
 void SimonEngine::allocTablesHeap() {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list