[Scummvm-cvs-logs] CVS: scummvm boxes.cpp,1.21,1.22 actor.cpp,1.41,1.42 scummvm.dsp,1.26,1.27

James Brown ender at users.sourceforge.net
Mon Mar 25 21:24:01 CET 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv28580

Modified Files:
	boxes.cpp actor.cpp scummvm.dsp 
Log Message:
Update project file, and add some checks for uninitied arrays. Stops full throttle crashing, until the AKOS bug.



Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** boxes.cpp	24 Mar 2002 17:49:46 -0000	1.21
--- boxes.cpp	26 Mar 2002 05:23:06 -0000	1.22
***************
*** 27,30 ****
--- 27,32 ----
  byte Scumm::getMaskFromBox(int box) {
  	Box *ptr = getBoxBaseAddr(box);
+ 	if (!ptr)
+ 		return 0;
  	return ptr->mask;
  }
***************
*** 32,35 ****
--- 34,39 ----
  byte Scumm::getBoxFlags(int box) {
  	Box *ptr = getBoxBaseAddr(box);
+ 	if (!ptr)
+ 		return 0;
  	return ptr->flags;
  }
***************
*** 39,42 ****
--- 43,48 ----
  		return(255);
  	Box *ptr = getBoxBaseAddr(box);
+ 	if (!box)
+ 		return 255;
  	return FROM_LE_16(ptr->scale);
  }
***************
*** 44,47 ****
--- 50,54 ----
  byte Scumm::getNumBoxes() {
  	byte *ptr = getResourceAddress(rtMatrix, 2);
+ 	if (!ptr) return 0;
  	return ptr[0];
  }
***************
*** 49,52 ****
--- 56,61 ----
  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) {

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** actor.cpp	20 Mar 2002 22:58:41 -0000	1.41
--- actor.cpp	26 Mar 2002 05:23:06 -0000	1.42
***************
*** 490,493 ****
--- 490,496 ----
                          if (iterations > 1000) return abr;   /* Safety net */
  			box = getNumBoxes() - 1;
+ 			if (box == 0)
+ 				return abr;
+ 
  			best = (uint)0xFFFF;
  			b = 0;

Index: scummvm.dsp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.dsp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** scummvm.dsp	25 Mar 2002 08:46:24 -0000	1.26
--- scummvm.dsp	26 Mar 2002 05:23:06 -0000	1.27
***************
*** 230,233 ****
--- 230,237 ----
  # Begin Source File
  
+ SOURCE=.\init.cpp
+ # End Source File
+ # Begin Source File
+ 
  SOURCE=.\insane.cpp
  # End Source File





More information about the Scummvm-git-logs mailing list