diff options
author | James Brown | 2002-03-26 05:23:06 +0000 |
---|---|---|
committer | James Brown | 2002-03-26 05:23:06 +0000 |
commit | 4045ffa462d0e3994aa433f8016d0a6c2eaf383a (patch) | |
tree | 7ec947c07ccb5a94d08e4d60503e5ae80e49473e /boxes.cpp | |
parent | 2c3657168f7ee5330688b005c1573daddeac9047 (diff) | |
download | scummvm-rg350-4045ffa462d0e3994aa433f8016d0a6c2eaf383a.tar.gz scummvm-rg350-4045ffa462d0e3994aa433f8016d0a6c2eaf383a.tar.bz2 scummvm-rg350-4045ffa462d0e3994aa433f8016d0a6c2eaf383a.zip |
Update project file, and add some checks for uninitied arrays. Stops full throttle crashing, until the AKOS bug.
svn-id: r3835
Diffstat (limited to 'boxes.cpp')
-rw-r--r-- | boxes.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -26,11 +26,15 @@ byte Scumm::getMaskFromBox(int box) { Box *ptr = getBoxBaseAddr(box); + if (!ptr) + return 0; return ptr->mask; } byte Scumm::getBoxFlags(int box) { Box *ptr = getBoxBaseAddr(box); + if (!ptr) + return 0; return ptr->flags; } @@ -38,16 +42,21 @@ int Scumm::getBoxScale(int box) { if(_features & GF_NO_SCALLING) return(255); Box *ptr = getBoxBaseAddr(box); + if (!box) + return 255; return FROM_LE_16(ptr->scale); } byte Scumm::getNumBoxes() { byte *ptr = getResourceAddress(rtMatrix, 2); + if (!ptr) return 0; return ptr[0]; } Box *Scumm::getBoxBaseAddr(int box) { byte *ptr = getResourceAddress(rtMatrix, 2); + if (!ptr) + return NULL; checkRange(ptr[0]-1, 0, box, "Illegal box %d"); if(_features & GF_SMALL_HEADER) { if (_features & GF_OLD256) |