aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scenes.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-28 08:29:22 +0300
committerEugene Sandulenko2013-09-06 14:51:20 +0300
commitf1eb4043c2601f1d5f18aec3841b838942939d8c (patch)
tree7fd1c64560e44b985a9003df505278d5ea9db6d6 /engines/fullpipe/scenes.cpp
parentb209329a1d2924064ddf47c35be76f0c2361419a (diff)
downloadscummvm-rg350-f1eb4043c2601f1d5f18aec3841b838942939d8c.tar.gz
scummvm-rg350-f1eb4043c2601f1d5f18aec3841b838942939d8c.tar.bz2
scummvm-rg350-f1eb4043c2601f1d5f18aec3841b838942939d8c.zip
FULLPIPE: Fix couple of Coverity defects
Diffstat (limited to 'engines/fullpipe/scenes.cpp')
-rw-r--r--engines/fullpipe/scenes.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 6a8b78a9a8..c3cf810345 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -776,16 +776,19 @@ int global_messageHandler1(ExCommand *cmd) {
if (!g_fullpipe->_currSelectedInventoryItemId && !g_fullpipe->_aniMan->_movement &&
!(g_fullpipe->_aniMan->_flags & 0x100) && g_fullpipe->_aniMan->isIdle()) {
int st = g_fullpipe->_aniMan->_statics->_staticsId;
- ExCommand *newex;
+ ExCommand *newex = 0;
if (st == ST_MAN_RIGHT) {
newex = new ExCommand(g_fullpipe->_aniMan->_id, 1, rMV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
} else if (st == (0x4000 | ST_MAN_RIGHT)) {
newex = new ExCommand(g_fullpipe->_aniMan->_id, 1, MV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
}
- newex->_keyCode = g_fullpipe->_aniMan->_okeyCode;
- newex->_excFlags |= 3;
- newex->postMessage();
+
+ if (newex) {
+ newex->_keyCode = g_fullpipe->_aniMan->_okeyCode;
+ newex->_excFlags |= 3;
+ newex->postMessage();
+ }
}
if (g_fullpipe->_currSelectedInventoryItemId != invItem)
@@ -953,7 +956,10 @@ int global_messageHandler3(ExCommand *cmd) {
}
return result;
case 29:
- if (g_fullpipe->_gameLoader->_interactionController->_flag24 && g_fullpipe->_currentScene) {
+ if (!g_fullpipe->_currentScene)
+ return result;
+
+ if (g_fullpipe->_gameLoader->_interactionController->_flag24) {
ani = g_fullpipe->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
ani2 = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_gameLoader->_field_FA, -1);
if (ani) {