[Scummvm-cvs-logs] scummvm master -> 621364edaef3a10618b62a2424ba775c2380c23d

eriktorbjorn eriktorbjorn at telia.com
Wed Apr 24 20:52:49 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
621364edae LURE: Fix bounds checking


Commit: 621364edaef3a10618b62a2424ba775c2380c23d
    https://github.com/scummvm/scummvm/commit/621364edaef3a10618b62a2424ba775c2380c23d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-04-24T11:50:06-07:00

Commit Message:
LURE: Fix bounds checking

CID 1003986 and CID 1003990.

Changed paths:
    engines/lure/res_struct.cpp



diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index aee4f11..15e7c13 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))






More information about the Scummvm-git-logs mailing list