diff options
author | Max Horn | 2010-11-01 21:06:04 +0000 |
---|---|---|
committer | Max Horn | 2010-11-01 21:06:04 +0000 |
commit | 9cadcf4c5b755adbdf8381bcdd82e14f097f2304 (patch) | |
tree | 7904817f501354a8952bf7aa33f865afc7f4c764 /engines | |
parent | 7f1a9699fa2489955f3839ccbd8dddad97d864ff (diff) | |
download | scummvm-rg350-9cadcf4c5b755adbdf8381bcdd82e14f097f2304.tar.gz scummvm-rg350-9cadcf4c5b755adbdf8381bcdd82e14f097f2304.tar.bz2 scummvm-rg350-9cadcf4c5b755adbdf8381bcdd82e14f097f2304.zip |
TINSEL: Fix a leak in DW2, and a potential OOB in NextTaggedActor
svn-id: r54029
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tinsel/actors.cpp | 7 | ||||
-rw-r--r-- | engines/tinsel/sched.cpp | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 3577f4e0cc..b6f6259b94 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -199,6 +199,10 @@ void RegisterActors(int num) { void FreeActors() { free(actorInfo); actorInfo = NULL; + if (TinselV2) { + free(zFactors); + zFactors = NULL; + } } /** @@ -625,7 +629,7 @@ int NextTaggedActor() { PMOVER pActor; bool hid; - do { + while (ti < NumActors); { if (actorInfo[ti].tagged) { pActor = GetMover(ti+1); if (pActor) @@ -637,6 +641,7 @@ int NextTaggedActor() { return ++ti; } } + ++ti; } while (++ti < NumActors); return 0; diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index 08a68d2d4a..d90312d271 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -760,6 +760,7 @@ void GlobalProcesses(uint32 numProcess, byte *pProcess) { */ void FreeGlobalProcesses() { delete[] pGlobalProcess; + pGlobalProcess = 0; numGlobalProcess = 0; } |