From 1c0367d5a60ca21e0a273175a7f9fb3eeadfd795 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 9 Nov 2013 18:20:29 +0100 Subject: TOON: Fix unintialized variables. Fix CID 1002424 --- engines/toon/toon.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/toon/toon.cpp') diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index a97bfd55e8..7b1456b05c 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -952,6 +952,18 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription) _lastRenderTime = 0; _firstFrame = false; _needPaletteFlush = true; + + _numVariant = 0; + _currentCutaway = nullptr; + for (int i = 0; i < 4; i++) { + _scriptState[i].ip = nullptr; + _scriptState[i].dataPtr = nullptr; + _scriptState[i].retValue = 0; + _scriptState[i].bp = 0; + _scriptState[i].sp = 0; + _scriptState[i].running = false; + } + _currentScriptRegion = 0; } ToonEngine::~ToonEngine() { -- cgit v1.2.3