dmusic: Do not write outside of array bounds.

This commit is contained in:
Peter Oberndorfer 2006-10-27 18:47:25 +02:00 committed by Alexandre Julliard
parent 0d0bfa4cce
commit 62c6d61ddf
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLS
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;
}