diff options
author | Travis Howell | 2006-04-01 12:26:50 +0000 |
---|---|---|
committer | Travis Howell | 2006-04-01 12:26:50 +0000 |
commit | d10929b3945da6a2909e34c0cc2b730346a0a6b2 (patch) | |
tree | 3e140cecd4773af9e368fe24fa224019c8535076 /engines | |
parent | 361572af2cafd5b488bdf9b582895820d1208b7f (diff) | |
download | scummvm-rg350-d10929b3945da6a2909e34c0cc2b730346a0a6b2.tar.gz scummvm-rg350-d10929b3945da6a2909e34c0cc2b730346a0a6b2.tar.bz2 scummvm-rg350-d10929b3945da6a2909e34c0cc2b730346a0a6b2.zip |
Always check array bounds are valid in HE games, matching original
svn-id: r21524
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/he/script_v100he.cpp | 3 | ||||
-rw-r--r-- | engines/scumm/he/script_v72he.cpp | 3 | ||||
-rw-r--r-- | engines/scumm/he/script_v90he.cpp | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 73cb2bb4c9..99fac87340 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -634,6 +634,8 @@ void ScummEngine_v100he::o100_arrayOps() { if (id == 0) { defineArray(array, kDwordArray, dim2start, dim2end, dim1start, dim1end); } + checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end); + tmp2 = 0; while (dim2start <= dim2end) { tmp = dim1start; @@ -674,6 +676,7 @@ void ScummEngine_v100he::o100_arrayOps() { if (id == 0) { defineArray(array, kDwordArray, dim2start, dim2end, dim1start, dim1end); } + checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end); offs = (b >= c) ? 1 : -1; tmp2 = c; diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 741167e228..69edc4b51c 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -1422,6 +1422,8 @@ void ScummEngine_v72he::o72_arrayOps() { if (id == 0) { defineArray(array, kDwordArray, dim2start, dim2end, dim1start, dim1end); } + checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end); + tmp2 = 0; while (dim2start <= dim2end) { tmp = dim1start; @@ -1462,6 +1464,7 @@ void ScummEngine_v72he::o72_arrayOps() { if (id == 0) { defineArray(array, kDwordArray, dim2start, dim2end, dim1start, dim1end); } + checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end); offs = (b >= c) ? 1 : -1; tmp2 = c; diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index cdfe909ee0..19b80b4195 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -2320,6 +2320,7 @@ void ScummEngine_v90he::o90_sortArray() { int dim2end = pop(); int dim2start = pop(); getArrayDim(array, &dim2start, &dim2end, &dim1start, &dim1end); + checkArrayLimits(array, dim2start, dim2end, dim1start, dim1end); sortArray(array, dim2start, dim2end, dim1start, dim1end, sortOrder); } break; |