From 7e9dcffdf7034faa5ad72db5fa933d61b8c73996 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 7 Jun 2022 20:54:10 -0700 Subject: [PATCH] Do not play invalid sfx --- src/s_sound.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/s_sound.c b/src/s_sound.c index 1214472d7..9d3456f59 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -678,6 +678,14 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) if (!sfx->data) { sfx->data = I_GetSfx(sfx); + + if (!sfx->data) + { + CONS_Alert(CONS_WARNING, + "Tried to load invalid sfx_%s\n", + sfx->name); + return;/* don't play it */ + } } // increase the usefulness