aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boot <bootc@bootc.net>2011-05-30 14:03:38 +0100
committerChris Boot <bootc@bootc.net>2011-05-30 14:03:38 +0100
commitde7b116240b0534b5e1eda302ece12798b09ac6e (patch)
tree75f9586e2679d2e90e1bf67052ce3c07a6597fdb
parentff2f1c1192a17c54af87d1afce3b4317cfc0fcc7 (diff)
Fix buggy realloc() in CDVDAudio::Finish() which causes memory corruption.
-rw-r--r--xbmc/cores/dvdplayer/DVDAudio.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/xbmc/cores/dvdplayer/DVDAudio.cpp b/xbmc/cores/dvdplayer/DVDAudio.cpp
index ee52772ae6..d0f8e195c4 100644
--- a/xbmc/cores/dvdplayer/DVDAudio.cpp
+++ b/xbmc/cores/dvdplayer/DVDAudio.cpp
@@ -238,7 +238,7 @@ void CDVDAudio::Finish()
if(silence > 0 && m_iBufferSize > 0)
{
CLog::Log(LOGDEBUG, "CDVDAudio::Drain - adding %d bytes of silence, buffer size: %d, chunk size: %d", silence, m_iBufferSize, m_dwPacketSize);
- m_pBuffer = (BYTE*)realloc(m_pBuffer, m_dwPacketSize);
+ m_pBuffer = (BYTE*)realloc(m_pBuffer, m_iBufferSize + silence);
memset(m_pBuffer+m_iBufferSize, 0, silence);
m_iBufferSize += silence;
}