aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-31 08:53:50 -0400
committerPaul Gilbert2014-08-31 08:53:50 -0400
commitc96247ca573fe315f92473331e8276e328daab03 (patch)
tree0703dcdc37cc75122beb1e8fb628750bcdd5367f /engines
parentec634ea07c24143e3e1736fec8934d120018fbd6 (diff)
downloadscummvm-rg350-c96247ca573fe315f92473331e8276e328daab03.tar.gz
scummvm-rg350-c96247ca573fe315f92473331e8276e328daab03.tar.bz2
scummvm-rg350-c96247ca573fe315f92473331e8276e328daab03.zip
MADS: Fix some memory leaks
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/nebular/nebular_scenes.cpp2
-rw-r--r--engines/mads/scene.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp
index c71512ed4c..b5e2491624 100644
--- a/engines/mads/nebular/nebular_scenes.cpp
+++ b/engines/mads/nebular/nebular_scenes.cpp
@@ -331,7 +331,7 @@ void SceneInfoNebular::loadCodes(MSurface &depthSurface, Common::SeekableReadStr
byte runValue = stream->readByte();
// Write out the run length
- Common::fill(destP, destP + runLength, runValue);
+ Common::fill(destP, MIN(endP, destP + runLength), runValue);
destP += runLength;
// Get the next run length
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 1f95749fd8..cb68d38eec 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -82,6 +82,7 @@ Scene::Scene(MADSEngine *vm)
Scene::~Scene() {
delete _sceneLogic;
delete _sceneInfo;
+ delete _animationData;
}
void Scene::clearVocab() {