diff options
| author | Ludvig Strigeus | 2002-04-13 11:11:41 +0000 | 
|---|---|---|
| committer | Ludvig Strigeus | 2002-04-13 11:11:41 +0000 | 
| commit | 223d1bd858fb109ebdda8787bedfdb677fca7375 (patch) | |
| tree | ed07835076c7796420d7dfeb47fd06c2c5710024 | |
| parent | f5f504ae97b0c6960d5d32265a0bf0c19f5da2ff (diff) | |
| download | scummvm-rg350-223d1bd858fb109ebdda8787bedfdb677fca7375.tar.gz scummvm-rg350-223d1bd858fb109ebdda8787bedfdb677fca7375.tar.bz2 scummvm-rg350-223d1bd858fb109ebdda8787bedfdb677fca7375.zip | |
prevent crash if no wav file available
svn-id: r3919
| -rw-r--r-- | simon/simon.cpp | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/simon/simon.cpp b/simon/simon.cpp index 494eba0548..a6d2232884 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -1744,7 +1744,7 @@ void SimonState::o_177() {  		uint a = getVarOrByte();  		uint b = getVarOrByte();  		Child2 *child = findChildOfType2(getNextItemPtr()); -		const char *s; +		const char *s = NULL;  		ThreeValues *tv = NULL;  		char buf[256]; @@ -7894,6 +7894,12 @@ void SimonState::playSound(uint sound) {  		/* 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]; | 
