wineoss.drv: Use offsetof to calculate the size of a struct with variable length array.

This commit is contained in:
Michael Stefaniuc 2013-02-13 23:44:39 +01:00 committed by Alexandre Julliard
parent 1a1577d791
commit f128551439
1 changed files with 1 additions and 2 deletions

View File

@ -1115,8 +1115,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
void* extra;
extra = HeapAlloc(GetProcessHeap(), 0,
sizeof(struct sFMextra) +
sizeof(struct sVoice) * (MidiOutDev[wDevID].caps.wVoices - 1));
offsetof(struct sFMextra, voice[MidiOutDev[wDevID].caps.wVoices]));
if (extra == 0) {
WARN("can't alloc extra data !\n");