From c96247ca573fe315f92473331e8276e328daab03 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 31 Aug 2014 08:53:50 -0400 Subject: MADS: Fix some memory leaks --- engines/mads/nebular/nebular_scenes.cpp | 2 +- engines/mads/scene.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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() { -- cgit v1.2.3