aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-12-20 18:52:05 +0000
committerTorbjörn Andersson2007-12-20 18:52:05 +0000
commit0e744e491b785a8983fc5f4ab35d7ec644caa45e (patch)
tree249a44211db442a0eee8734ebfc4990d1bd81764 /engines
parent094f1748876f97d4bfdd3cfa7bcfb9057c18d5f9 (diff)
downloadscummvm-rg350-0e744e491b785a8983fc5f4ab35d7ec644caa45e.tar.gz
scummvm-rg350-0e744e491b785a8983fc5f4ab35d7ec644caa45e.tar.bz2
scummvm-rg350-0e744e491b785a8983fc5f4ab35d7ec644caa45e.zip
Fixed compiler warning, and a potential (but very unlikely) out-of-bounds read.
svn-id: r29926
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/function.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index d63bfe5fe0..25899a56ed 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -1818,13 +1818,7 @@ int32 opcodeType8(void) {
if (opcode > 0x100)
return (-21);
- if(opcode > sizeof(opcodeTablePtr) / sizeof(opcodeFunction)) {
- printf("Unsupported opcode %d in opcode type 8\n", opcode);
- pushVar(0);
- }
-
-
- if (opcodeTablePtr[opcode]) {
+ if (opcode < ARRAYSIZE(opcodeTablePtr) && opcodeTablePtr[opcode]) {
// printf("Function: %d\n",opcode);
pushVar(opcodeTablePtr[opcode] ());
return (0);