From 226cb92aac292b971ca4a5b60c133e11b9ab5221 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 20 Mar 2011 21:42:57 -0500 Subject: [PATCH] prevent possible WAV read hang (thanks to Steve Checkoway) --- src/RageSoundReader_WAV.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RageSoundReader_WAV.cpp b/src/RageSoundReader_WAV.cpp index 19263ce22e..0af1f10e30 100644 --- a/src/RageSoundReader_WAV.cpp +++ b/src/RageSoundReader_WAV.cpp @@ -374,7 +374,7 @@ public: int iFramesToCopy = (m_iBufferAvail-m_iBufferUsed) / iBytesPerFrame; iFramesToCopy = min( iFramesToCopy, (int) (iFrames-iGotFrames) ); int iSamplesToCopy = iFramesToCopy * iSamplesPerFrame; - int iBytesToCopy = iSamplesToCopy * sizeof(int16_t); + int iBytesToCopy = iSamplesToCopy * sizeof(float); memcpy( buf, m_pBuffer+m_iBufferUsed, iBytesToCopy ); m_iBufferUsed += iBytesToCopy; iGotFrames += iFramesToCopy;