PATCH: mmioAdvance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
lpmmioinfo can sometimes, proven in the read case, be NULL.

-- 
Johan Gill, johane@lysator.liu.se
Index: wine/dlls/winmm/mmio.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mmio.c,v
retrieving revision 1.31
diff -u -u -r1.31 mmio.c
--- wine/dlls/winmm/mmio.c	9 Mar 2002 23:44:33 -0000	1.31
+++ wine/dlls/winmm/mmio.c	14 May 2002 13:29:10 -0000
@@ -1284,17 +1284,21 @@
     }
     if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR)
 	return MMIOERR_CANNOTWRITE;
-    wm->dwFileSize = max(wm->dwFileSize, lpmmioinfo->lBufOffset + (lpmmioinfo->pchNext - lpmmioinfo->pchBuffer));
 
+    if (lpmmioinfo) {
+	wm->dwFileSize = max(wm->dwFileSize, lpmmioinfo->lBufOffset + (lpmmioinfo->pchNext - lpmmioinfo->pchBuffer));
+    }
     MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ);
 
-    lpmmioinfo->pchNext = lpmmioinfo->pchBuffer;
-    lpmmioinfo->pchEndRead  = lpmmioinfo->pchBuffer + 
-	(wm->info.pchEndRead - wm->info.pchBuffer);
-    lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + 
-	(wm->info.pchEndWrite - wm->info.pchBuffer);
-    lpmmioinfo->lDiskOffset = wm->info.lDiskOffset;
-    lpmmioinfo->lBufOffset = wm->info.lBufOffset;
+    if (lpmmioinfo) {
+	lpmmioinfo->pchNext = lpmmioinfo->pchBuffer;
+	lpmmioinfo->pchEndRead  = lpmmioinfo->pchBuffer + 
+	    (wm->info.pchEndRead - wm->info.pchBuffer);
+	lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + 
+	    (wm->info.pchEndWrite - wm->info.pchBuffer);
+	lpmmioinfo->lDiskOffset = wm->info.lDiskOffset;
+	lpmmioinfo->lBufOffset = wm->info.lBufOffset;
+    }
     return MMSYSERR_NOERROR;
 }
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux