Fixed size of buffers in conversion.

This commit is contained in:
Eric Pouech 2002-04-01 21:02:27 +00:00 committed by Alexandre Julliard
parent 1e5389339e
commit 3209f949b3
1 changed files with 8 additions and 0 deletions

View File

@ -233,10 +233,18 @@ static DWORD wodWrite(WAVEMAPDATA* wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwParam2)
lpWaveHdrSrc->dwFlags |= WHDR_INQUEUE;
ash = (PACMSTREAMHEADER)lpWaveHdrSrc->reserved;
/* acmStreamConvert will actually check that the new size is less than initial size */
ash->cbSrcLength = lpWaveHdrSrc->dwBufferLength;
if (acmStreamConvert(wom->hAcmStream, ash, 0L) != MMSYSERR_NOERROR)
return MMSYSERR_ERROR;
lpWaveHdrDst = (LPWAVEHDR)((LPSTR)ash + sizeof(ACMSTREAMHEADER));
if (ash->cbDstLengthUsed == 0)
{
/* something went wrong in decoding */
FIXME("Got 0 length\n");
return MMSYSERR_ERROR;
}
lpWaveHdrDst->dwBufferLength = ash->cbDstLengthUsed;
return waveOutWrite(wom->hInnerWave, lpWaveHdrDst, sizeof(*lpWaveHdrDst));
}