wineoss.drv: Use offsetof to calculate the size of a struct with variable length array.
This commit is contained in:
parent
1a1577d791
commit
f128551439
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue