aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoost Peters2009-08-02 21:22:46 +0000
committerJoost Peters2009-08-02 21:22:46 +0000
commit7cf43b9ddaa0f64a3844568d8cf9b19f46b6b627 (patch)
tree56f7a945a3c39960b8c5958b8d390a23c186b7eb /engines
parent9d360d946b35a1a520a5b43b688f085ab7e18727 (diff)
downloadscummvm-rg350-7cf43b9ddaa0f64a3844568d8cf9b19f46b6b627.tar.gz
scummvm-rg350-7cf43b9ddaa0f64a3844568d8cf9b19f46b6b627.tar.bz2
scummvm-rg350-7cf43b9ddaa0f64a3844568d8cf9b19f46b6b627.zip
Fix AGI crashes on 64-bit systems that require alignment
svn-id: r43011
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/sprite.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp
index f3c0b7365c..63ac880267 100644
--- a/engines/agi/sprite.cpp
+++ b/engines/agi/sprite.cpp
@@ -56,9 +56,10 @@ struct Sprite {
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;