[Scummvm-cvs-logs] SF.net SVN: scummvm:[43012] scummvm/branches/branch-1-0-0/engines/agi/ sprite.cpp
joostp at users.sourceforge.net
joostp at users.sourceforge.net
Sun Aug 2 23:23:16 CEST 2009
Revision: 43012
http://scummvm.svn.sourceforge.net/scummvm/?rev=43012&view=rev
Author: joostp
Date: 2009-08-02 21:23:16 +0000 (Sun, 02 Aug 2009)
Log Message:
-----------
Fix AGI crashes on 64-bit systems that require alignment
Modified Paths:
--------------
scummvm/branches/branch-1-0-0/engines/agi/sprite.cpp
Modified: scummvm/branches/branch-1-0-0/engines/agi/sprite.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/agi/sprite.cpp 2009-08-02 21:22:46 UTC (rev 43011)
+++ scummvm/branches/branch-1-0-0/engines/agi/sprite.cpp 2009-08-02 21:23:16 UTC (rev 43012)
@@ -56,9 +56,10 @@
void *SpritesMgr::poolAlloc(int size) {
uint8 *x;
- // Adjust size to 32-bit boundary to prevent data misalignment
+ // Adjust size to sizeof(void *) boundary to prevent data misalignment
// errors.
- size = (size + 3) & ~3;
+ const int alignPadding = sizeof(void*) - 1;
+ size = (size + alignPadding) & ~alignPadding;
x = _poolTop;
_poolTop += size;
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