winmm: Clear the fccType in mmioDescend for a not RIFF/LIST case

Dmitry Timoshkov dmitry at codeweavers.com
Wed Jun 18 04:53:05 CDT 2008


Hello,

a comment in mmioDescend clearly tells that only RIFF/LIST chunks have
an extra DWORD, and that DWORD is fccType. This patch makes the mmio test
pass with a real AVI file.

Changelog:
    winmm: Clear the fccType in mmioDescend for a not RIFF/LIST case.
---
 dlls/winmm/mmio.c       |    3 +++
 dlls/winmm/tests/mmio.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c
index c2df106..8ff2bf2 100644
--- a/dlls/winmm/mmio.c
+++ b/dlls/winmm/mmio.c
@@ -1223,7 +1223,10 @@ MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck,
     if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST)
 	mmioSeek(hmmio, lpck->dwDataOffset + sizeof(DWORD), SEEK_SET);
     else
+    {
 	mmioSeek(hmmio, lpck->dwDataOffset, SEEK_SET);
+	lpck->fccType = 0;
+    }
     TRACE("lpck: ckid=%.4s, cksize=%d, dwDataOffset=%d fccType=%08X (%.4s)!\n",
 	  (LPSTR)&lpck->ckid, lpck->cksize, lpck->dwDataOffset,
 	  lpck->fccType, srchType?(LPSTR)&lpck->fccType:"");
diff --git a/dlls/winmm/tests/mmio.c b/dlls/winmm/tests/mmio.c
index 72b16b1..c0dd357 100644
--- a/dlls/winmm/tests/mmio.c
+++ b/dlls/winmm/tests/mmio.c
@@ -32,7 +32,7 @@ static const DWORD RIFF_buf[] =
 {
     FOURCC_RIFF, 7*sizeof(DWORD)+sizeof(MainAVIHeader), mmioFOURCC('A','V','I',' '),
     FOURCC_LIST, sizeof(DWORD)+sizeof(MMCKINFO)+sizeof(MainAVIHeader), listtypeAVIHEADER,
-    ckidAVIMAINHDR, sizeof(MainAVIHeader),
+    ckidAVIMAINHDR, sizeof(MainAVIHeader), 0xdeadbeef, 0xdeadbeef,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-- 
1.5.5.4






More information about the wine-patches mailing list