aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-03-03 14:13:40 +1100
committerPaul Gilbert2012-03-03 14:13:40 +1100
commit83f193edbd97af01904c45934bfaafb4c11efecc (patch)
treec3d81a6cac3b33e73b65717bf8658c6aa5cbc4e0
parent101ec2b885aade21216c1bba8488711b30d192eb (diff)
downloadscummvm-rg350-83f193edbd97af01904c45934bfaafb4c11efecc.tar.gz
scummvm-rg350-83f193edbd97af01904c45934bfaafb4c11efecc.tar.bz2
scummvm-rg350-83f193edbd97af01904c45934bfaafb4c11efecc.zip
TSAGE: Fix memory leak and error in R2R Animation Player free
-rw-r--r--engines/tsage/graphics.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 5ddc7b6a1a..b3dceba292 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -223,11 +223,13 @@ GfxSurface::GfxSurface() : _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) {
_lockSurfaceCtr = 0;
_customSurface = NULL;
_transColor = -1;
+ _trackDirtyRects = false;
}
GfxSurface::GfxSurface(const GfxSurface &s) {
_lockSurfaceCtr = 0;
_customSurface = NULL;
+ _trackDirtyRects = false;
this->operator =(s);
}
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index fb5f4a0eab..4cfcc29d24 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -1927,7 +1927,8 @@ void AnimationPlayer::close() {
_animData2 = NULL;
_field38 = 0;
- R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0);
+ if (g_globals != NULL)
+ R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0);
}
void AnimationPlayer::rleDecode(const byte *pSrc, byte *pDest, int size) {