Commit c9d24bdc authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

avifil32: Fix treating the return values of mmio* functions as HRESULTs instead of MMRESULTs.

(Found by PreFast.)
parent 6357f9c0
...@@ -145,7 +145,7 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck, ...@@ -145,7 +145,7 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck,
{ {
FOURCC ckid; FOURCC ckid;
FOURCC fccType; FOURCC fccType;
HRESULT hr; MMRESULT mmr;
/* pre-conditions */ /* pre-conditions */
assert(extra != NULL); assert(extra != NULL);
...@@ -171,12 +171,13 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck, ...@@ -171,12 +171,13 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck,
TRACE(": find ckid=0x%08X fccType=0x%08X\n", ckid, fccType); TRACE(": find ckid=0x%08X fccType=0x%08X\n", ckid, fccType);
for (;;) { for (;;) {
hr = mmioDescend(hmmio, lpck, lpckParent, 0); mmr = mmioDescend(hmmio, lpck, lpckParent, 0);
if (hr != S_OK) { if (mmr != MMSYSERR_NOERROR) {
/* No extra chunks in front of desired chunk? */ /* No extra chunks in front of desired chunk? */
if (flags == 0 && hr == MMIOERR_CHUNKNOTFOUND) if (flags == 0 && mmr == MMIOERR_CHUNKNOTFOUND)
hr = AVIERR_OK; return AVIERR_OK;
return hr; else
return AVIERR_FILEREAD;
} }
/* Have we found what we search for? */ /* Have we found what we search for? */
...@@ -187,10 +188,15 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck, ...@@ -187,10 +188,15 @@ HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck,
/* Skip padding chunks, the others put into the extrachunk-structure */ /* Skip padding chunks, the others put into the extrachunk-structure */
if (lpck->ckid == ckidAVIPADDING || if (lpck->ckid == ckidAVIPADDING ||
lpck->ckid == mmioFOURCC('p','a','d','d')) lpck->ckid == mmioFOURCC('p','a','d','d'))
hr = mmioAscend(hmmio, lpck, 0); {
mmr = mmioAscend(hmmio, lpck, 0);
if (mmr != MMSYSERR_NOERROR) return AVIERR_FILEREAD;
}
else else
hr = ReadChunkIntoExtra(extra, hmmio, lpck); {
if (FAILED(hr)) HRESULT hr = ReadChunkIntoExtra(extra, hmmio, lpck);
return hr; if (FAILED(hr))
return hr;
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment