aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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];