aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/res_struct.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2013-04-24 20:50:06 +0200
committerTorbjörn Andersson2013-04-24 20:50:06 +0200
commit621364edaef3a10618b62a2424ba775c2380c23d (patch)
tree47ab0f060c20acac0ee5ffe2ac263d4ae4285b45 /engines/lure/res_struct.cpp
parent048d24660bdefd2711ff08091de2b0973ce1c19d (diff)
downloadscummvm-rg350-621364edaef3a10618b62a2424ba775c2380c23d.tar.gz
scummvm-rg350-621364edaef3a10618b62a2424ba775c2380c23d.tar.bz2
scummvm-rg350-621364edaef3a10618b62a2424ba775c2380c23d.zip
LURE: Fix bounds checking
CID 1003986 and CID 1003990.
Diffstat (limited to 'engines/lure/res_struct.cpp')
-rw-r--r--engines/lure/res_struct.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index aee4f11215..15e7c1302d 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -1262,7 +1262,7 @@ bool ValueTableData::isKnownField(uint16 fieldIndex) {
}
uint16 ValueTableData::getField(uint16 fieldIndex) {
- if (fieldIndex > NUM_VALUE_FIELDS)
+ if (fieldIndex >= NUM_VALUE_FIELDS)
error("Invalid field index specified %d", fieldIndex);
// if (!isKnownField(fieldIndex))
// warning("Unknown field index %d in GET_FIELD opcode", fieldIndex);
@@ -1274,7 +1274,7 @@ uint16 ValueTableData::getField(FieldName fieldName) {
}
void ValueTableData::setField(uint16 fieldIndex, uint16 value) {
- if (fieldIndex > NUM_VALUE_FIELDS)
+ if (fieldIndex >= NUM_VALUE_FIELDS)
error("Invalid field index specified %d", fieldIndex);
_fieldList[fieldIndex] = value;
// if (!isKnownField(fieldIndex))