Commit f1285514 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent 1a1577d7
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment