diff options
author | Strangerke | 2014-05-31 18:05:54 +0200 |
---|---|---|
committer | Strangerke | 2014-05-31 18:06:32 +0200 |
commit | 6283e7f423509aef5a6d37a61f4c664149e55b5f (patch) | |
tree | 0fbf1545312357e4ef543cd274dac48065d0f695 /engines/cruise/function.cpp | |
parent | e8a52b67e848172066a384ba1c116683177a8415 (diff) | |
download | scummvm-rg350-6283e7f423509aef5a6d37a61f4c664149e55b5f.tar.gz scummvm-rg350-6283e7f423509aef5a6d37a61f4c664149e55b5f.tar.bz2 scummvm-rg350-6283e7f423509aef5a6d37a61f4c664149e55b5f.zip |
CRUISE: Add a couple of safeguards to avoid potential division by zero
Diffstat (limited to 'engines/cruise/function.cpp')
-rw-r--r-- | engines/cruise/function.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 327dec4d6c..e0053ec017 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -87,9 +87,7 @@ int16 Op_Exec() { int numOfArgToPop = popVar(); - int i = 0; - - for (i = 0; i < numOfArgToPop; i++) { + for (int i = 0; i < numOfArgToPop; i++) { popTable[numOfArgToPop - i - 1] = popVar(); } @@ -111,7 +109,7 @@ int16 Op_Exec() { ptr2 = ptr; - for (i = 0; i < numOfArgToPop; i++) { + for (int i = 0; i < numOfArgToPop; i++) { WRITE_BE_UINT16(ptr2, popTable[i]); ptr2 += 2; } |