mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-01 15:55:45 +00:00
Converted zoneData and zoneQuery tables from plain array types to Common::Array. Should help catch out of bounds access errors that may cause memory corruption.
svn-id: r33727
This commit is contained in:
parent
983a4f21e5
commit
ef3b72d5e4
@ -132,6 +132,14 @@ void CineEngine::initialize() {
|
||||
animDataTable.resize(NUM_MAX_ANIMDATA);
|
||||
freeAnimDataTable();
|
||||
|
||||
// Resize zone data table to its correct size and reset all its elements
|
||||
zoneData.resize(NUM_MAX_ZONE);
|
||||
Common::set_to(zoneData.begin(), zoneData.end(), 0);
|
||||
|
||||
// Resize zone query table to its correct size and reset all its elements
|
||||
zoneQuery.resize(NUM_MAX_ZONE);
|
||||
Common::set_to(zoneQuery.begin(), zoneQuery.end(), 0);
|
||||
|
||||
_timerDelayMultiplier = 12; // Set default speed
|
||||
setupOpcodes();
|
||||
|
||||
|
@ -341,9 +341,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
|
||||
|
||||
// Clear the zoneQuery table (Operation Stealth specific)
|
||||
if (g_cine->getGameType() == Cine::GType_OS) {
|
||||
for (uint i = 0; i < NUM_MAX_ZONE; i++) {
|
||||
zoneQuery[i] = 0;
|
||||
}
|
||||
Common::set_to(zoneQuery.begin(), zoneQuery.end(), 0);
|
||||
}
|
||||
|
||||
if (g_cine->getGameType() == Cine::GType_OS) {
|
||||
|
@ -126,8 +126,8 @@ CommandeType objectListCommand[20];
|
||||
int16 objListTab[20];
|
||||
|
||||
uint16 exitEngine;
|
||||
uint16 zoneData[NUM_MAX_ZONE];
|
||||
uint16 zoneQuery[NUM_MAX_ZONE]; //!< Only exists in Operation Stealth
|
||||
Common::Array<uint16> zoneData;
|
||||
Common::Array<uint16> zoneQuery; //!< Only exists in Operation Stealth
|
||||
|
||||
/*! \brief Move the player character using the keyboard
|
||||
* \param x Negative values move left, positive right, zero not at all
|
||||
|
@ -129,8 +129,8 @@ struct SelectedObjStruct {
|
||||
};
|
||||
|
||||
#define NUM_MAX_ZONE 16
|
||||
extern uint16 zoneData[NUM_MAX_ZONE];
|
||||
extern uint16 zoneQuery[NUM_MAX_ZONE];
|
||||
extern Common::Array<uint16> zoneData;
|
||||
extern Common::Array<uint16> zoneQuery;
|
||||
|
||||
void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 param5);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user