From 285d96be4d642def1221e184f63bb9b75df75071 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 8 Oct 2015 00:37:54 +0200 Subject: doom: fix bogus pointer arithmetic, do sfx initialization in two passes for linked sounds --- sys/src/games/doom/i_sound.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/src/games/doom/i_sound.c b/sys/src/games/doom/i_sound.c index 5ff4715cd..a9a9cc3cd 100644 --- a/sys/src/games/doom/i_sound.c +++ b/sys/src/games/doom/i_sound.c @@ -135,17 +135,20 @@ void I_InitSound(void) /* Initialize external data (all sounds) at start, keep static. */ for (i=1 ; idata; - lengths[i] = lengths[(S_sfx[i].link - S_sfx)/sizeof(sfxinfo_t)]; + lengths[i] = lengths[S_sfx[i].link - S_sfx]; } } -- cgit v1.2.3