diff --git a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 757c52b62d..0b4a958e8b 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -340,7 +340,7 @@ void RageSound_Generic_Software::StartMixing( RageSoundBase *snd ) /* Prebuffer some frames before changing the sound to PLAYING. */ bool ReachedEOF = false; int frames_filled = 0; - while( !ReachedEOF && frames_to_buffer < min_fill_frames ) + while( !ReachedEOF && frames_filled < min_fill_frames && frames_filled < BufferSize ) { // LOG->Trace("StartMixing: (#%i) buffering %i (%i writable) (%p)", i, (int) frames_to_buffer, s.buffer.num_writable(), s.snd ); int wrote = GetDataForSound( s );