Commit 4822ad20 authored by Dino Bollinger's avatar Dino Bollinger Committed by Richard Gobeille
Browse files

Duke3D: Prevent segfaults when no sounds are defined.

parent f33c7cea
......@@ -94,6 +94,13 @@ void S_SoundStartup(void)
#endif
nullsound.voices = &nullvoice;
if (!g_sounds)
{
Bassert(g_highestSoundIdx == 0);
g_sounds = (sound_t **)Xmalloc(sizeof(intptr_t));
g_sounds[0] = &nullsound;
}
for (int i = 0; i <= g_highestSoundIdx; ++i)
{
if (g_sounds[i] == &nullsound)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment