Commit 8701f92e authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

msvfw32: Use a helper to free memory.

parent 40922ccd
...@@ -1401,6 +1401,15 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL ...@@ -1401,6 +1401,15 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL
return NULL; return NULL;
} }
static void clear_compvars(PCOMPVARS pc)
{
HeapFree(GetProcessHeap(), 0, pc->lpbiIn);
HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev);
HeapFree(GetProcessHeap(), 0, pc->lpBitsOut);
HeapFree(GetProcessHeap(), 0, pc->lpState);
pc->lpbiIn = pc->lpBitsPrev = pc->lpBitsOut = pc->lpState = NULL;
}
/*********************************************************************** /***********************************************************************
* ICSeqCompressFrameEnd [MSVFW32.@] * ICSeqCompressFrameEnd [MSVFW32.@]
*/ */
...@@ -1410,11 +1419,7 @@ void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc) ...@@ -1410,11 +1419,7 @@ void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc)
TRACE("(%p)\n", pc); TRACE("(%p)\n", pc);
ret = ICSendMessage(pc->hic, ICM_COMPRESS_END, 0, 0); ret = ICSendMessage(pc->hic, ICM_COMPRESS_END, 0, 0);
TRACE(" -- %x\n", ret); TRACE(" -- %x\n", ret);
HeapFree(GetProcessHeap(), 0, pc->lpbiIn); clear_compvars(pc);
HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev);
HeapFree(GetProcessHeap(), 0, pc->lpBitsOut);
HeapFree(GetProcessHeap(), 0, pc->lpState);
pc->lpbiIn = pc->lpBitsPrev = pc->lpBitsOut = pc->lpState = NULL;
} }
/*********************************************************************** /***********************************************************************
...@@ -1474,11 +1479,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn) ...@@ -1474,11 +1479,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
return TRUE; return TRUE;
} }
error: error:
HeapFree(GetProcessHeap(), 0, pc->lpbiIn); clear_compvars(pc);
HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev);
HeapFree(GetProcessHeap(), 0, pc->lpState);
HeapFree(GetProcessHeap(), 0, pc->lpBitsOut);
pc->lpBitsPrev = pc->lpbiIn = pc->lpState = pc->lpBitsOut = NULL;
return FALSE; return FALSE;
} }
......
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