Wavemapper

Eric Pouech eric.pouech at wanadoo.fr
Mon Apr 1 10:34:06 CST 2002


this patch fixes the size of (generally) the last buffer
requested to be transformed by the wavemapper (in fact, when
the actual size of the buffer is strictly less than the size
of the buffer announced while preparing the buffer)

A+
-------------- next part --------------
Name:          wavemap
ChangeLog:     fixed size of buffers in conversion
License:       X11
GenDate:       2002/04/01 15:45:22 UTC
ModifiedFiles: dlls/winmm/wavemap/wavemap.c
AddedFiles:    
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/wavemap/wavemap.c,v
retrieving revision 1.17
diff -u -u -r1.17 wavemap.c
--- dlls/winmm/wavemap/wavemap.c	9 Mar 2002 23:44:34 -0000	1.17
+++ dlls/winmm/wavemap/wavemap.c	31 Mar 2002 14:37:41 -0000
@@ -233,10 +233,18 @@
     
     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));
 }


More information about the wine-patches mailing list