diff options
author | David Eriksson | 2003-10-06 08:24:38 +0000 |
---|---|---|
committer | David Eriksson | 2003-10-06 08:24:38 +0000 |
commit | 7b87bc6970ec6169c9877cf4cb0720c7be909f12 (patch) | |
tree | da3b1ea87357752b531a3e833fbbdb1a6e0a133b /queen | |
parent | 8979adac04dbc1075e6c9f5d14e635202fcc2f2a (diff) | |
download | scummvm-rg350-7b87bc6970ec6169c9877cf4cb0720c7be909f12.tar.gz scummvm-rg350-7b87bc6970ec6169c9877cf4cb0720c7be909f12.tar.bz2 scummvm-rg350-7b87bc6970ec6169c9877cf4cb0720c7be909f12.zip |
Check array bounds.
svn-id: r10633
Diffstat (limited to 'queen')
-rw-r--r-- | queen/logic.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp index c21a1f8fe1..d7e37ad137 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -139,9 +139,9 @@ void Logic::initialise() { ptr += 2; } - _objMax = new int16[_numRooms + 1]; - _areaMax = new int16[_numRooms + 1]; - _area = new int16[_numRooms + 1][11][8]; + _objMax = new int16[_numRooms + 1]; + _areaMax = new int16[_numRooms + 1]; + _area = new int16[_numRooms + 1][11][8]; for (i = 1; i < (_numRooms + 1); i++) { _objMax[i] = (int16)READ_BE_UINT16(ptr); @@ -151,6 +151,8 @@ void Logic::initialise() { for (j = 1; j < (_areaMax[i] + 1); j++) for (k = 0; k < 8; k++) { + if (j > 11) + error("j (%i) too large, _areaMax[i] = %i", j, _areaMax[i]); _area[i][j][k] = READ_BE_UINT16(ptr); ptr += 2; } |