aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudvig Strigeus2002-04-13 11:11:41 +0000
committerLudvig Strigeus2002-04-13 11:11:41 +0000
commit223d1bd858fb109ebdda8787bedfdb677fca7375 (patch)
treeed07835076c7796420d7dfeb47fd06c2c5710024
parentf5f504ae97b0c6960d5d32265a0bf0c19f5da2ff (diff)
downloadscummvm-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.cpp8
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];