Module: wine Branch: master Commit: 62c6d61ddf3073cabe540325836137180b1f1d39 URL: http://source.winehq.org/git/wine.git/?a=commit;h=62c6d61ddf3073cabe54032583...
Author: Peter Oberndorfer kumbayo84@arcor.de Date: Fri Oct 27 18:47:25 2006 +0200
dmusic: Do not write outside of array bounds.
---
dlls/dmusic/dmusic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index daa489b..675430a 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -133,7 +133,7 @@ static HRESULT WINAPI IDirectMusic8Impl_ This->nrofports++; if (!This->ppPorts) This->ppPorts = HeapAlloc(GetProcessHeap(), 0, sizeof(LPDIRECTMUSICPORT) * This->nrofports); else This->ppPorts = HeapReAlloc(GetProcessHeap(), 0, This->ppPorts, sizeof(LPDIRECTMUSICPORT) * This->nrofports); - This->ppPorts[This->nrofports] = pNewPort; + This->ppPorts[This->nrofports - 1] = pNewPort; *ppPort = (LPDIRECTMUSICPORT) pNewPort; return S_OK; }