Commit 7d437222 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Only copy amount requested up to size of structure.

parent 48244607
...@@ -222,12 +222,14 @@ UINT16 WINAPI mixerGetDevCaps16(UINT16 devid, LPMIXERCAPS16 mixcaps, ...@@ -222,12 +222,14 @@ UINT16 WINAPI mixerGetDevCaps16(UINT16 devid, LPMIXERCAPS16 mixcaps,
UINT ret = mixerGetDevCapsA(devid, &micA, sizeof(micA)); UINT ret = mixerGetDevCapsA(devid, &micA, sizeof(micA));
if (ret == MMSYSERR_NOERROR) { if (ret == MMSYSERR_NOERROR) {
mixcaps->wMid = micA.wMid; MIXERCAPS16 mic16;
mixcaps->wPid = micA.wPid; mic16.wMid = micA.wMid;
mixcaps->vDriverVersion = micA.vDriverVersion; mic16.wPid = micA.wPid;
strcpy(mixcaps->szPname, micA.szPname); mic16.vDriverVersion = micA.vDriverVersion;
mixcaps->fdwSupport = micA.fdwSupport; strcpy(mic16.szPname, micA.szPname);
mixcaps->cDestinations = micA.cDestinations; mic16.fdwSupport = micA.fdwSupport;
mic16.cDestinations = micA.cDestinations;
memcpy(mixcaps, &mic16, min(size, sizeof(mic16)));
} }
return ret; return ret;
} }
...@@ -1208,7 +1210,7 @@ UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID, ...@@ -1208,7 +1210,7 @@ UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID,
woc16.dwFormats = wocA.dwFormats; woc16.dwFormats = wocA.dwFormats;
woc16.wChannels = wocA.wChannels; woc16.wChannels = wocA.wChannels;
woc16.dwSupport = wocA.dwSupport; woc16.dwSupport = wocA.dwSupport;
memcpy(lpCaps, &woc16, uSize); memcpy(lpCaps, &woc16, min(uSize, sizeof(woc16)));
} }
return ret; return ret;
} }
...@@ -1504,7 +1506,7 @@ UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, ...@@ -1504,7 +1506,7 @@ UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps,
strcpy(wic16.szPname, wicA.szPname); strcpy(wic16.szPname, wicA.szPname);
wic16.dwFormats = wicA.dwFormats; wic16.dwFormats = wicA.dwFormats;
wic16.wChannels = wicA.wChannels; wic16.wChannels = wicA.wChannels;
memcpy(lpCaps, &wic16, uSize); memcpy(lpCaps, &wic16, min(uSize, sizeof(wic16)));
} }
return ret; return ret;
} }
......
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