diff options
author | Filippos Karapetis | 2010-10-15 12:40:24 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-10-15 12:40:24 +0000 |
commit | 7cdddd5ffb1501e5612a77c91aa282fc19cf2bed (patch) | |
tree | 10fdb49978db02583ab1815890e96d86e39bf734 /engines/sci/engine | |
parent | 34cc54eaa92d0aa02c8c61b6c3522776971988b2 (diff) | |
download | scummvm-rg350-7cdddd5ffb1501e5612a77c91aa282fc19cf2bed.tar.gz scummvm-rg350-7cdddd5ffb1501e5612a77c91aa282fc19cf2bed.tar.bz2 scummvm-rg350-7cdddd5ffb1501e5612a77c91aa282fc19cf2bed.zip |
SCI: Fixed code bugs from bug #3087872 - "SCI: Code analysis warnings"
svn-id: r53482
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 07385fd3f9..9ef2025337 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -351,7 +351,8 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { dest[0] = dest[1] = NULL_REG; if (text.empty() || !dest) { // Empty text - dest[2] = dest[3] = make_reg(0, 0); + if (dest) + dest[2] = dest[3] = make_reg(0, 0); debugC(2, kDebugLevelStrings, "GetTextSize: Empty string"); return s->r_acc; } diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index faf966af92..4ea28ed903 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1312,7 +1312,7 @@ static void AStar(PathfindingState *s) { } // Check if we are done - if (vertex_min == s->vertex_end) + if (vertex_min == s->vertex_end || !vertex_min) break; // Move vertex from set open to set closed |