aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/animation.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-06-04 09:30:10 -0400
committerPaul Gilbert2014-06-04 09:30:10 -0400
commitc551115b4b31e653cc046b6ea91fd306e6b8dc5e (patch)
tree26fc79c7ad84e448eb1d91531fd5a267db744c49 /engines/mads/animation.cpp
parent38b705a238e104a755ed0f48aa2b40a0214eba83 (diff)
downloadscummvm-rg350-c551115b4b31e653cc046b6ea91fd306e6b8dc5e.tar.gz
scummvm-rg350-c551115b4b31e653cc046b6ea91fd306e6b8dc5e.tar.bz2
scummvm-rg350-c551115b4b31e653cc046b6ea91fd306e6b8dc5e.zip
MADS: Fix memory corruption when dealing with monster in scene 703
Diffstat (limited to 'engines/mads/animation.cpp')
-rw-r--r--engines/mads/animation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index 6af8a9ae5f..512a3979f9 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -310,8 +310,10 @@ void Animation::load(UserInterface &interfaceSurface, DepthSurface &depthSurface
for (int idx = 0; idx < _header._spriteSetsCount; ++idx)
usageList.push_back(_spriteSets[idx]->_usageIndex);
- if (usageList.size() > 0)
- _vm->_palette->_paletteUsage.updateUsage(usageList, _header._messagesCount);
+ if (usageList.size() > 0) {
+ int spritesUsageIndex = _spriteSets[0]->_usageIndex;
+ _vm->_palette->_paletteUsage.updateUsage(usageList, spritesUsageIndex);
+ }
// Remaps the sprite list indexes for frames to the loaded sprite list indexes
for (uint i = 0; i < _frameEntries.size(); ++i) {