mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 05:15:01 +00:00
avifil32: Fix some memory leaks.
This commit is contained in:
parent
ae8e8a0a57
commit
3d61013e7c
2 changed files with 10 additions and 8 deletions
|
@ -1913,7 +1913,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
|
|||
hres = AVIStreamReadFormat(pInStreams[curStream], sInfo.dwStart,
|
||||
lpBuffer, &lBufferSize);
|
||||
if (FAILED(hres))
|
||||
return hres;
|
||||
goto error;
|
||||
AVIStreamSetFormat(pOutStreams[curStream], sInfo.dwStart,
|
||||
lpBuffer, lBufferSize);
|
||||
|
||||
|
|
|
@ -1018,14 +1018,15 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream *iface, LONG pos,
|
|||
lppc->peNew[n].peFlags = 0;
|
||||
}
|
||||
|
||||
if (mmioSeek(This->paf->hmmio, This->paf->dwNextFramePos, SEEK_SET) == -1)
|
||||
return AVIERR_FILEWRITE;
|
||||
if (mmioCreateChunk(This->paf->hmmio, &ck, 0) != S_OK)
|
||||
return AVIERR_FILEWRITE;
|
||||
if (mmioWrite(This->paf->hmmio, (HPSTR)lppc, ck.cksize) != ck.cksize)
|
||||
return AVIERR_FILEWRITE;
|
||||
if (mmioAscend(This->paf->hmmio, &ck, 0) != S_OK)
|
||||
if (mmioSeek(This->paf->hmmio, This->paf->dwNextFramePos, SEEK_SET) == -1 ||
|
||||
mmioCreateChunk(This->paf->hmmio, &ck, 0) != S_OK ||
|
||||
mmioWrite(This->paf->hmmio, (HPSTR)lppc, ck.cksize) != ck.cksize ||
|
||||
mmioAscend(This->paf->hmmio, &ck, 0) != S_OK)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lppc);
|
||||
return AVIERR_FILEWRITE;
|
||||
}
|
||||
|
||||
This->paf->dwNextFramePos += ck.cksize + 2 * sizeof(DWORD);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lppc);
|
||||
|
@ -1939,6 +1940,7 @@ static HRESULT AVIFILE_LoadIndex(const IAVIFileImpl *This, DWORD size, DWORD off
|
|||
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pStream->nIdxFrames * sizeof(AVIINDEXENTRY));
|
||||
if (pStream->idxFrames == NULL && pStream->nIdxFrames > 0) {
|
||||
pStream->nIdxFrames = 0;
|
||||
HeapFree(GetProcessHeap(), 0, lp);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue