mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 20:18:28 +00:00
wineoss: Fix the buffer size check for more than 2 channels.
This commit is contained in:
parent
376f74b452
commit
55fca7778b
1 changed files with 4 additions and 2 deletions
|
@ -2169,6 +2169,7 @@ static DWORD wodClose(WORD wDevID)
|
|||
*/
|
||||
static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
|
||||
{
|
||||
WORD delta;
|
||||
TRACE("(%u, %p, %08X);\n", wDevID, lpWaveHdr, dwSize);
|
||||
|
||||
/* first, do the sanity checks... */
|
||||
|
@ -2187,10 +2188,11 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
|
|||
lpWaveHdr->dwFlags |= WHDR_INQUEUE;
|
||||
lpWaveHdr->lpNext = 0;
|
||||
|
||||
if ((lpWaveHdr->dwBufferLength & (WOutDev[wDevID].waveFormat.Format.nBlockAlign - 1)) != 0)
|
||||
delta = lpWaveHdr->dwBufferLength % WOutDev[wDevID].waveFormat.Format.nBlockAlign;
|
||||
if (delta != 0)
|
||||
{
|
||||
WARN("WaveHdr length isn't a multiple of the PCM block size: %d %% %d\n",lpWaveHdr->dwBufferLength,WOutDev[wDevID].waveFormat.Format.nBlockAlign);
|
||||
lpWaveHdr->dwBufferLength &= ~(WOutDev[wDevID].waveFormat.Format.nBlockAlign - 1);
|
||||
lpWaveHdr->dwBufferLength -= delta;
|
||||
}
|
||||
|
||||
OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE);
|
||||
|
|
Loading…
Reference in a new issue