[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.2,1.3

Ludvig Strigeus strigeus at users.sourceforge.net
Sat Apr 13 04:12:05 CEST 2002


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

Modified Files:
	simon.cpp 
Log Message:
prevent crash if no wav file available

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** simon.cpp	13 Apr 2002 10:41:26 -0000	1.2
--- simon.cpp	13 Apr 2002 11:11:41 -0000	1.3
***************
*** 1745,1749 ****
  		uint b = getVarOrByte();
  		Child2 *child = findChildOfType2(getNextItemPtr());
! 		const char *s;
  		ThreeValues *tv = NULL;
  		char buf[256];
--- 1745,1749 ----
  		uint b = getVarOrByte();
  		Child2 *child = findChildOfType2(getNextItemPtr());
! 		const char *s = NULL;
  		ThreeValues *tv = NULL;
  		char buf[256];
***************
*** 7895,7898 ****
--- 7895,7904 ----
  		/* stop any currently playing sound */
  		_sound_size = 0;
+ 
+ 		/* Check if _sfx_heap is NULL */
+ 		if (_sfx_heap == NULL) {
+ 			warning("playSound(%d) cannot play. No voice file loaded", sound);
+ 			return;
+ 		}
  		
  		p = _sfx_heap + ((uint32*)_sfx_heap)[sound];





More information about the Scummvm-git-logs mailing list