diff options
author | Strangerke | 2013-10-30 00:27:10 +0100 |
---|---|---|
committer | Strangerke | 2013-10-30 00:27:38 +0100 |
commit | 0898bfd977668846f60195531d26a92ce9ac7f4e (patch) | |
tree | c3406d14db54440b3bb7c683a250e18ad94e1df9 /engines/toon | |
parent | 706d1f9f81fcd579c90781656c8feec68e938c95 (diff) | |
download | scummvm-rg350-0898bfd977668846f60195531d26a92ce9ac7f4e.tar.gz scummvm-rg350-0898bfd977668846f60195531d26a92ce9ac7f4e.tar.bz2 scummvm-rg350-0898bfd977668846f60195531d26a92ce9ac7f4e.zip |
TOON: Fix CID 1002425, 1002426, 1003214
Diffstat (limited to 'engines/toon')
-rw-r--r-- | engines/toon/script_func.cpp | 6 | ||||
-rw-r--r-- | engines/toon/state.cpp | 4 | ||||
-rw-r--r-- | engines/toon/tools.cpp | 7 |
3 files changed, 14 insertions, 3 deletions
diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index 1fa4058114..06580cde2e 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -1060,9 +1060,9 @@ int32 ScriptFunc::sys_Cmd_Set_Location_Data(EMCState *state) { // initial setup of locations int32 locationId = stackPos(0); debugC(0, 0, "setlocationdata(%d) %s %x %s %s %d %d", locationId, GetText(1, state), stackPos(2), GetText(3, state), GetText(4, state), stackPos(5), stackPos(6)); - strcpy(_vm->state()->_locations[locationId]._name, GetText(1, state)); - strcpy(_vm->state()->_locations[locationId]._music, GetText(3, state)); - strcpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state)); + strncpy(_vm->state()->_locations[locationId]._name, GetText(1, state), 64); + strncpy(_vm->state()->_locations[locationId]._music, GetText(3, state), 64); + strncpy(_vm->state()->_locations[locationId]._cutaway, GetText(4, state), 64); _vm->state()->_locations[locationId]._flags = stackPos(2); _vm->state()->_locations[locationId]._visited = false; _vm->state()->_locations[locationId]._numSceneAnimations = stackPos(5); diff --git a/engines/toon/state.cpp b/engines/toon/state.cpp index 8e4abbd709..fffa8cf529 100644 --- a/engines/toon/state.cpp +++ b/engines/toon/state.cpp @@ -115,6 +115,10 @@ State::State(void) { #endif memset(_conversationState, 0, sizeof(Conversation) * 60); + + _conversationData = nullptr; + _currentConversationId = -1; + _exitConversation = true; } State::~State(void) { diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp index added39940..f5c77aca69 100644 --- a/engines/toon/tools.cpp +++ b/engines/toon/tools.cpp @@ -136,6 +136,13 @@ uint32 decompressSPCN(byte *src, byte *dst, uint32 dstsize) { RncDecoder::RncDecoder() { initCrc(); + + _bitBuffl = 0; + _bitBuffh = 0; + _bitCount = 0; + _srcPtr = nullptr; + _dstPtr = nullptr; + _inputByteLeft = 0; } RncDecoder::~RncDecoder() { } |