Commit 982fb2fd authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

msvfw32: Simplify error handling in ICSeqCompressFrameStart.

parent 4c80ec02
...@@ -1433,28 +1433,18 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn) ...@@ -1433,28 +1433,18 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
*pc->lpbiIn = *lpbiIn; *pc->lpbiIn = *lpbiIn;
pc->lpBitsPrev = HeapAlloc(GetProcessHeap(), 0, pc->lpbiIn->bmiHeader.biSizeImage); pc->lpBitsPrev = HeapAlloc(GetProcessHeap(), 0, pc->lpbiIn->bmiHeader.biSizeImage);
if (!pc->lpBitsPrev) if (!pc->lpBitsPrev)
{ goto error;
HeapFree(GetProcessHeap(), 0, pc->lpbiIn);
return FALSE;
}
pc->lpState = HeapAlloc(GetProcessHeap(), 0, sizeof(ICCOMPRESS)); pc->lpState = HeapAlloc(GetProcessHeap(), 0, sizeof(ICCOMPRESS));
if (!pc->lpState) if (!pc->lpState)
{ goto error;
HeapFree(GetProcessHeap(), 0, pc->lpbiIn);
HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev);
return FALSE;
}
pc->cbState = sizeof(ICCOMPRESS); pc->cbState = sizeof(ICCOMPRESS);
pc->lpBitsOut = HeapAlloc(GetProcessHeap(), 0, pc->lpbiOut->bmiHeader.biSizeImage); pc->lpBitsOut = HeapAlloc(GetProcessHeap(), 0, pc->lpbiOut->bmiHeader.biSizeImage);
if (!pc->lpBitsOut) if (!pc->lpBitsOut)
{ goto error;
HeapFree(GetProcessHeap(), 0, pc->lpbiIn);
HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev);
HeapFree(GetProcessHeap(), 0, pc->lpState);
return FALSE;
}
TRACE("Compvars:\n" TRACE("Compvars:\n"
"\tpc:\n" "\tpc:\n"
"\tsize: %i\n" "\tsize: %i\n"
...@@ -1483,6 +1473,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn) ...@@ -1483,6 +1473,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
icComp->lpbiPrev = &pc->lpbiIn->bmiHeader; icComp->lpbiPrev = &pc->lpbiIn->bmiHeader;
return TRUE; return TRUE;
} }
error:
HeapFree(GetProcessHeap(), 0, pc->lpbiIn); HeapFree(GetProcessHeap(), 0, pc->lpbiIn);
HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev); HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev);
HeapFree(GetProcessHeap(), 0, pc->lpState); HeapFree(GetProcessHeap(), 0, pc->lpState);
......
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