From a4ba86ee31bd815b0c4b4d5b8fa6b19ac394847e Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 1 Nov 2011 22:02:54 +0000 Subject: [PATCH] Explicitly initialize voice->Playing and voice->Paused members in some sound playback functions. Without these, there would be an uninitialized access in line 444 of multivoc.c (if the memory in question was allocated with malloc, but still...) git-svn-id: https://svn.eduke32.com/eduke32@2101 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/jaudiolib/src/multivoc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/jaudiolib/src/multivoc.c b/polymer/eduke32/source/jaudiolib/src/multivoc.c index 16fa3be89..e83e065fe 100644 --- a/polymer/eduke32/source/jaudiolib/src/multivoc.c +++ b/polymer/eduke32/source/jaudiolib/src/multivoc.c @@ -1820,7 +1820,6 @@ int32_t MV_StartDemandFeedPlayback voice->DemandFeed = function; voice->LoopStart = NULL; voice->LoopCount = 0; - voice->BlockLength = 0; voice->position = 0; voice->sound = NULL; voice->length = 0; @@ -1913,6 +1912,7 @@ int32_t MV_PlayLoopedRaw voice->channels = 1; voice->GetSound = MV_GetNextRawBlock; voice->Playing = TRUE; + voice->Paused = FALSE; voice->NextBlock = ptr; voice->position = 0; voice->BlockLength = length; @@ -2282,6 +2282,8 @@ int32_t MV_PlayLoopedVOC return(MV_Error); } + voice->Playing = TRUE; + voice->Paused = FALSE; voice->wavetype = VOC; voice->bits = 8; voice->channels = 1;