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

This commit is contained in:
Johan Gill 2002-05-16 18:27:52 +00:00 committed by Alexandre Julliard
parent 1222aa63d5
commit b4f3cc9507
1 changed files with 12 additions and 8 deletions

View File

@ -1284,17 +1284,21 @@ MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
} }
if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR) if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR)
return MMIOERR_CANNOTWRITE; 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); MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ);
lpmmioinfo->pchNext = lpmmioinfo->pchBuffer; if (lpmmioinfo) {
lpmmioinfo->pchEndRead = lpmmioinfo->pchBuffer + lpmmioinfo->pchNext = lpmmioinfo->pchBuffer;
(wm->info.pchEndRead - wm->info.pchBuffer); lpmmioinfo->pchEndRead = lpmmioinfo->pchBuffer +
lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + (wm->info.pchEndRead - wm->info.pchBuffer);
(wm->info.pchEndWrite - wm->info.pchBuffer); lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer +
lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; (wm->info.pchEndWrite - wm->info.pchBuffer);
lpmmioinfo->lBufOffset = wm->info.lBufOffset; lpmmioinfo->lDiskOffset = wm->info.lDiskOffset;
lpmmioinfo->lBufOffset = wm->info.lBufOffset;
}
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }