Check uSize parameter in waveOutUnprepareHeader and

waveOutPrepareHeader.
This commit is contained in:
Sean Young 2004-02-26 05:28:01 +00:00 committed by Alexandre Julliard
parent 3d7034e79e
commit 65130e8a5d
1 changed files with 5 additions and 1 deletions

View File

@ -2607,7 +2607,8 @@ UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
if (lpWaveOutHdr == NULL) return MMSYSERR_INVALPARAM; if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR))
return MMSYSERR_INVALPARAM;
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
return MMSYSERR_INVALHANDLE; return MMSYSERR_INVALHANDLE;
@ -2625,6 +2626,9 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR))
return MMSYSERR_INVALPARAM;
if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) { if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) {
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }