Commit 45c6da65 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

msvfw32: Use CRT allocation functions.

parent 90a5dc72
...@@ -82,8 +82,8 @@ HDRAWDIB VFWAPI DrawDibOpen(void) ...@@ -82,8 +82,8 @@ HDRAWDIB VFWAPI DrawDibOpen(void)
WINE_HDD* whdd; WINE_HDD* whdd;
TRACE("(void)\n"); TRACE("(void)\n");
whdd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_HDD)); whdd = calloc(1, sizeof(WINE_HDD));
TRACE("=> %p\n", whdd); TRACE("=> %p\n", whdd);
while (MSVIDEO_GetHddPtr((HDRAWDIB)HDD_HandleRef) != NULL) HDD_HandleRef++; while (MSVIDEO_GetHddPtr((HDRAWDIB)HDD_HandleRef) != NULL) HDD_HandleRef++;
...@@ -118,7 +118,7 @@ BOOL VFWAPI DrawDibClose(HDRAWDIB hdd) ...@@ -118,7 +118,7 @@ BOOL VFWAPI DrawDibClose(HDRAWDIB hdd)
} }
} }
HeapFree(GetProcessHeap(), 0, whdd); free(whdd);
return TRUE; return TRUE;
} }
...@@ -137,15 +137,15 @@ BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) ...@@ -137,15 +137,15 @@ BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd)
whdd->hpal = 0; /* Do not free this */ whdd->hpal = 0; /* Do not free this */
whdd->hdc = 0; whdd->hdc = 0;
HeapFree(GetProcessHeap(), 0, whdd->lpbi); free(whdd->lpbi);
whdd->lpbi = NULL; whdd->lpbi = NULL;
HeapFree(GetProcessHeap(), 0, whdd->lpbiOut); free(whdd->lpbiOut);
whdd->lpbiOut = NULL; whdd->lpbiOut = NULL;
whdd->begun = FALSE; whdd->begun = FALSE;
/*if (whdd->lpvbits) /*if (whdd->lpvbits)
HeapFree(GetProcessHeap(), 0, whdd->lpvbuf);*/ free(whdd->lpvbuf);*/
if (whdd->hMemDC) if (whdd->hMemDC)
{ {
...@@ -224,7 +224,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, ...@@ -224,7 +224,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd,
if (ret) if (ret)
{ {
whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, size); whdd->lpbiOut = malloc(size);
if (ICDecompressGetFormat(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK) if (ICDecompressGetFormat(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK)
ret = FALSE; ret = FALSE;
...@@ -255,14 +255,14 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, ...@@ -255,14 +255,14 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd,
else else
{ {
dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD); dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD);
whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, dwSize); whdd->lpbiOut = malloc(dwSize);
memcpy(whdd->lpbiOut, lpbi, dwSize); memcpy(whdd->lpbiOut, lpbi, dwSize);
} }
} }
if (ret) if (ret)
{ {
/*whdd->lpvbuf = HeapAlloc(GetProcessHeap(), 0, whdd->lpbiOut->biSizeImage);*/ /*whdd->lpvbuf = malloc(whdd->lpbiOut->biSizeImage);*/
whdd->hMemDC = CreateCompatibleDC(hdc); whdd->hMemDC = CreateCompatibleDC(hdc);
TRACE("Creating: %ld, %p\n", whdd->lpbiOut->biSize, whdd->lpvbits); TRACE("Creating: %ld, %p\n", whdd->lpbiOut->biSize, whdd->lpvbits);
...@@ -284,7 +284,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, ...@@ -284,7 +284,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd,
whdd->hdc = hdc; whdd->hdc = hdc;
whdd->dxDst = dxDst; whdd->dxDst = dxDst;
whdd->dyDst = dyDst; whdd->dyDst = dyDst;
whdd->lpbi = HeapAlloc(GetProcessHeap(), 0, lpbi->biSize); whdd->lpbi = malloc(lpbi->biSize);
memcpy(whdd->lpbi, lpbi, lpbi->biSize); memcpy(whdd->lpbi, lpbi, lpbi->biSize);
whdd->dxSrc = dxSrc; whdd->dxSrc = dxSrc;
whdd->dySrc = dySrc; whdd->dySrc = dySrc;
...@@ -295,7 +295,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, ...@@ -295,7 +295,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd,
{ {
if (whdd->hic) if (whdd->hic)
ICClose(whdd->hic); ICClose(whdd->hic);
HeapFree(GetProcessHeap(), 0, whdd->lpbiOut); free(whdd->lpbiOut);
whdd->lpbiOut = NULL; whdd->lpbiOut = NULL;
} }
......
...@@ -254,7 +254,7 @@ static LRESULT MCIWND_Create(HWND hWnd, LPCREATESTRUCTW cs) ...@@ -254,7 +254,7 @@ static LRESULT MCIWND_Create(HWND hWnd, LPCREATESTRUCTW cs)
MCIWndInfo *mwi; MCIWndInfo *mwi;
static const WCHAR buttonW[] = {'b','u','t','t','o','n',0}; static const WCHAR buttonW[] = {'b','u','t','t','o','n',0};
mwi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*mwi)); mwi = calloc(1, sizeof(*mwi));
if (!mwi) return -1; if (!mwi) return -1;
SetWindowLongW(hWnd, 0, (LPARAM)mwi); SetWindowLongW(hWnd, 0, (LPARAM)mwi);
...@@ -388,12 +388,12 @@ static void MCIWND_notify_media(MCIWndInfo *mwi) ...@@ -388,12 +388,12 @@ static void MCIWND_notify_media(MCIWndInfo *mwi)
int len; int len;
len = WideCharToMultiByte(CP_ACP, 0, mwi->lpName, -1, NULL, 0, NULL, NULL); len = WideCharToMultiByte(CP_ACP, 0, mwi->lpName, -1, NULL, 0, NULL, NULL);
ansi_name = HeapAlloc(GetProcessHeap(), 0, len); ansi_name = malloc(len);
WideCharToMultiByte(CP_ACP, 0, mwi->lpName, -1, ansi_name, len, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, mwi->lpName, -1, ansi_name, len, NULL, NULL);
SendMessageW(mwi->hwndOwner, MCIWNDM_NOTIFYMEDIA, (WPARAM)mwi->hWnd, (LPARAM)ansi_name); SendMessageW(mwi->hwndOwner, MCIWNDM_NOTIFYMEDIA, (WPARAM)mwi->hWnd, (LPARAM)ansi_name);
HeapFree(GetProcessHeap(), 0, ansi_name); free(ansi_name);
} }
else else
SendMessageW(mwi->hwndOwner, MCIWNDM_NOTIFYMEDIA, (WPARAM)mwi->hWnd, (LPARAM)mwi->lpName); SendMessageW(mwi->hwndOwner, MCIWNDM_NOTIFYMEDIA, (WPARAM)mwi->hWnd, (LPARAM)mwi->lpName);
...@@ -468,7 +468,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa ...@@ -468,7 +468,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa
if (mwi->mci) if (mwi->mci)
SendMessageW(hWnd, MCI_CLOSE, 0, 0); SendMessageW(hWnd, MCI_CLOSE, 0, 0);
HeapFree(GetProcessHeap(), 0, mwi); free(mwi);
DestroyWindow(GetDlgItem(hWnd, CTL_MENU)); DestroyWindow(GetDlgItem(hWnd, CTL_MENU));
DestroyWindow(GetDlgItem(hWnd, CTL_PLAYSTOP)); DestroyWindow(GetDlgItem(hWnd, CTL_PLAYSTOP));
...@@ -591,9 +591,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa ...@@ -591,9 +591,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa
mwi->mci = mci_open.wDeviceID; mwi->mci = mci_open.wDeviceID;
mwi->alias = HandleToLong(hWnd) + 1; mwi->alias = HandleToLong(hWnd) + 1;
mwi->lpName = wcsdup((WCHAR *)lParam);
mwi->lpName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW((LPWSTR)lParam) + 1) * sizeof(WCHAR));
lstrcpyW(mwi->lpName, (LPWSTR)lParam);
MCIWND_UpdateState(mwi); MCIWND_UpdateState(mwi);
...@@ -660,7 +658,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa ...@@ -660,7 +658,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa
end_of_mci_open: end_of_mci_open:
if (wMsg == MCIWNDM_OPENA) if (wMsg == MCIWNDM_OPENA)
HeapFree(GetProcessHeap(), 0, (void *)lParam); free((void *)lParam);
return mwi->lasterror; return mwi->lasterror;
} }
...@@ -998,7 +996,7 @@ end_of_mci_open: ...@@ -998,7 +996,7 @@ end_of_mci_open:
pos = p - (WCHAR *)lParam + 1; pos = p - (WCHAR *)lParam + 1;
len = lstrlenW((LPCWSTR)lParam) + 64; len = lstrlenW((LPCWSTR)lParam) + 64;
cmdW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); cmdW = malloc(len * sizeof(WCHAR));
memcpy(cmdW, (void *)lParam, pos * sizeof(WCHAR)); memcpy(cmdW, (void *)lParam, pos * sizeof(WCHAR));
wsprintfW(cmdW + pos, formatW, mwi->alias); wsprintfW(cmdW + pos, formatW, mwi->alias);
...@@ -1013,10 +1011,10 @@ end_of_mci_open: ...@@ -1013,10 +1011,10 @@ end_of_mci_open:
MCIWND_notify_error(mwi); MCIWND_notify_error(mwi);
if (cmdW != (LPWSTR)lParam) if (cmdW != (LPWSTR)lParam)
HeapFree(GetProcessHeap(), 0, cmdW); free(cmdW);
if (wMsg == MCIWNDM_SENDSTRINGA) if (wMsg == MCIWNDM_SENDSTRINGA)
HeapFree(GetProcessHeap(), 0, (void *)lParam); free((void *)lParam);
MCIWND_UpdateState(mwi); MCIWND_UpdateState(mwi);
return mwi->lasterror; return mwi->lasterror;
...@@ -1182,7 +1180,7 @@ end_of_mci_open: ...@@ -1182,7 +1180,7 @@ end_of_mci_open:
if (mwi->mci) if (mwi->mci)
{ {
cmdW = HeapAlloc(GetProcessHeap(), 0, (lstrlenW((LPCWSTR)lParam) + 64) * sizeof(WCHAR)); cmdW = malloc((wcslen((WCHAR *)lParam) + 64) * sizeof(WCHAR));
wsprintfW(cmdW, formatW, mwi->alias); wsprintfW(cmdW, formatW, mwi->alias);
lstrcatW(cmdW, (WCHAR *)lParam); lstrcatW(cmdW, (WCHAR *)lParam);
...@@ -1193,11 +1191,11 @@ end_of_mci_open: ...@@ -1193,11 +1191,11 @@ end_of_mci_open:
SendDlgItemMessageW(hWnd, CTL_TRACKBAR, TBM_SETRANGEMAX, 1, SendDlgItemMessageW(hWnd, CTL_TRACKBAR, TBM_SETRANGEMAX, 1,
SendMessageW(hWnd, MCIWNDM_GETLENGTH, 0, 0)); SendMessageW(hWnd, MCIWNDM_GETLENGTH, 0, 0));
HeapFree(GetProcessHeap(), 0, cmdW); free(cmdW);
} }
if (wMsg == MCIWNDM_SETTIMEFORMATA) if (wMsg == MCIWNDM_SETTIMEFORMATA)
HeapFree(GetProcessHeap(), 0, (void *)lParam); free((void *)lParam);
return 0; return 0;
} }
...@@ -1347,7 +1345,7 @@ end_of_mci_open: ...@@ -1347,7 +1345,7 @@ end_of_mci_open:
mwi->mode = MCI_MODE_NOT_READY; mwi->mode = MCI_MODE_NOT_READY;
mwi->position = -1; mwi->position = -1;
HeapFree(GetProcessHeap(), 0, mwi->lpName); free(mwi->lpName);
mwi->lpName = NULL; mwi->lpName = NULL;
MCIWND_UpdateState(mwi); MCIWND_UpdateState(mwi);
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "vfw.h" #include "vfw.h"
#include "msvideo_private.h" #include "msvideo_private.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h" #include "wine/list.h"
/* Drivers32 settings */ /* Drivers32 settings */
...@@ -365,7 +364,7 @@ BOOL VFWAPI ICInstall(DWORD type, DWORD handler, LPARAM lparam, char *desc, UINT ...@@ -365,7 +364,7 @@ BOOL VFWAPI ICInstall(DWORD type, DWORD handler, LPARAM lparam, char *desc, UINT
switch (flags) switch (flags)
{ {
case ICINSTALL_FUNCTION: case ICINSTALL_FUNCTION:
if (!(driver = heap_alloc_zero(sizeof(*driver)))) if (!(driver = calloc(1, sizeof(*driver))))
return FALSE; return FALSE;
driver->fccType = type; driver->fccType = type;
driver->fccHandler = handler; driver->fccHandler = handler;
...@@ -414,7 +413,7 @@ BOOL VFWAPI ICRemove(DWORD type, DWORD handler, UINT flags) ...@@ -414,7 +413,7 @@ BOOL VFWAPI ICRemove(DWORD type, DWORD handler, UINT flags)
&& !compare_fourcc(handler, driver->fccHandler)) && !compare_fourcc(handler, driver->fccHandler))
{ {
list_remove(&driver->entry); list_remove(&driver->entry);
heap_free(driver); free(driver);
return TRUE; return TRUE;
} }
} }
...@@ -511,7 +510,7 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode) ...@@ -511,7 +510,7 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
return 0; return 0;
} }
if (!(whic = heap_alloc(sizeof(*whic)))) if (!(whic = malloc(sizeof(*whic))))
{ {
CloseDriver(hdrv, 0, 0); CloseDriver(hdrv, 0, 0);
return FALSE; return FALSE;
...@@ -550,7 +549,7 @@ HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPRO ...@@ -550,7 +549,7 @@ HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPRO
icopen.pV2Reserved = NULL; icopen.pV2Reserved = NULL;
icopen.dnDevNode = 0; /* FIXME */ icopen.dnDevNode = 0; /* FIXME */
if (!(whic = heap_alloc(sizeof(*whic)))) if (!(whic = malloc(sizeof(*whic))))
return NULL; return NULL;
whic->driverproc = lpfnHandler; whic->driverproc = lpfnHandler;
...@@ -566,7 +565,7 @@ HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPRO ...@@ -566,7 +565,7 @@ HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPRO
{ {
WARN("DRV_LOAD failed for hic %p\n", whic->hic); WARN("DRV_LOAD failed for hic %p\n", whic->hic);
MSVIDEO_FirstHic = whic->next; MSVIDEO_FirstHic = whic->next;
heap_free(whic); free(whic);
return 0; return 0;
} }
/* return value is not checked */ /* return value is not checked */
...@@ -580,7 +579,7 @@ HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPRO ...@@ -580,7 +579,7 @@ HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPRO
{ {
WARN("DRV_OPEN failed for hic %p\n", whic->hic); WARN("DRV_OPEN failed for hic %p\n", whic->hic);
MSVIDEO_FirstHic = whic->next; MSVIDEO_FirstHic = whic->next;
heap_free(whic); free(whic);
return 0; return 0;
} }
...@@ -898,7 +897,7 @@ static BOOL enum_compressors(HWND list, COMPVARS *pcv, BOOL enum_all) ...@@ -898,7 +897,7 @@ static BOOL enum_compressors(HWND list, COMPVARS *pcv, BOOL enum_all)
idx = SendMessageW(list, CB_ADDSTRING, 0, (LPARAM)icinfo.szDescription); idx = SendMessageW(list, CB_ADDSTRING, 0, (LPARAM)icinfo.szDescription);
ic = heap_alloc(sizeof(*ic)); ic = malloc(sizeof(*ic));
ic->icinfo = icinfo; ic->icinfo = icinfo;
ic->hic = hic; ic->hic = hic;
SendMessageW(list, CB_SETITEMDATA, idx, (LPARAM)ic); SendMessageW(list, CB_SETITEMDATA, idx, (LPARAM)ic);
...@@ -951,7 +950,7 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA ...@@ -951,7 +950,7 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA
LoadStringW(MSVFW32_hModule, IDS_FULLFRAMES, buf, 128); LoadStringW(MSVFW32_hModule, IDS_FULLFRAMES, buf, 128);
SendDlgItemMessageW(hdlg, IDC_COMP_LIST, CB_ADDSTRING, 0, (LPARAM)buf); SendDlgItemMessageW(hdlg, IDC_COMP_LIST, CB_ADDSTRING, 0, (LPARAM)buf);
ic = heap_alloc(sizeof(*ic)); ic = malloc(sizeof(*ic));
ic->icinfo.fccType = streamtypeVIDEO; ic->icinfo.fccType = streamtypeVIDEO;
ic->icinfo.fccHandler = comptypeDIB; ic->icinfo.fccHandler = comptypeDIB;
ic->hic = 0; ic->hic = 0;
...@@ -1072,7 +1071,7 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA ...@@ -1072,7 +1071,7 @@ static INT_PTR CALLBACK icm_choose_compressor_dlgproc(HWND hdlg, UINT msg, WPARA
if (!ic || (LONG_PTR)ic == CB_ERR) break; if (!ic || (LONG_PTR)ic == CB_ERR) break;
if (ic->hic) ICClose(ic->hic); if (ic->hic) ICClose(ic->hic);
heap_free(ic); free(ic);
} }
EndDialog(hdlg, LOWORD(wparam) == IDOK); EndDialog(hdlg, LOWORD(wparam) == IDOK);
...@@ -1153,13 +1152,13 @@ void VFWAPI ICCompressorFree(PCOMPVARS pc) ...@@ -1153,13 +1152,13 @@ void VFWAPI ICCompressorFree(PCOMPVARS pc)
ICClose(pc->hic); ICClose(pc->hic);
pc->hic = NULL; pc->hic = NULL;
} }
heap_free(pc->lpbiIn); free(pc->lpbiIn);
pc->lpbiIn = NULL; pc->lpbiIn = NULL;
heap_free(pc->lpBitsOut); free(pc->lpBitsOut);
pc->lpBitsOut = NULL; pc->lpBitsOut = NULL;
heap_free(pc->lpBitsPrev); free(pc->lpBitsPrev);
pc->lpBitsPrev = NULL; pc->lpBitsPrev = NULL;
heap_free(pc->lpState); free(pc->lpState);
pc->lpState = NULL; pc->lpState = NULL;
pc->dwFlags = 0; pc->dwFlags = 0;
} }
...@@ -1272,7 +1271,7 @@ LRESULT WINAPI ICClose(HIC hic) ...@@ -1272,7 +1271,7 @@ LRESULT WINAPI ICClose(HIC hic)
} }
} }
heap_free(whic); free(whic);
return 0; return 0;
} }
...@@ -1357,7 +1356,7 @@ HANDLE VFWAPI ICImageDecompress( ...@@ -1357,7 +1356,7 @@ HANDLE VFWAPI ICImageDecompress(
cbHdr = ICDecompressGetFormatSize(hic,lpbiIn); cbHdr = ICDecompressGetFormatSize(hic,lpbiIn);
if ( cbHdr < sizeof(BITMAPINFOHEADER) ) if ( cbHdr < sizeof(BITMAPINFOHEADER) )
goto err; goto err;
if (!(pHdr = heap_alloc_zero(cbHdr + sizeof(RGBQUAD) * 256))) if (!(pHdr = calloc(1, cbHdr + sizeof(RGBQUAD) * 256)))
goto err; goto err;
if ( ICDecompressGetFormat( hic, lpbiIn, pHdr ) != ICERR_OK ) if ( ICDecompressGetFormat( hic, lpbiIn, pHdr ) != ICERR_OK )
goto err; goto err;
...@@ -1412,7 +1411,7 @@ err: ...@@ -1412,7 +1411,7 @@ err:
ICDecompressEnd( hic ); ICDecompressEnd( hic );
if ( bReleaseIC ) if ( bReleaseIC )
ICClose(hic); ICClose(hic);
heap_free(pHdr); free(pHdr);
if ( pMem != NULL ) if ( pMem != NULL )
GlobalUnlock( hMem ); GlobalUnlock( hMem );
if ( !bSucceeded && hMem != NULL ) if ( !bSucceeded && hMem != NULL )
...@@ -1483,14 +1482,14 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL ...@@ -1483,14 +1482,14 @@ LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL
static void clear_compvars(PCOMPVARS pc) static void clear_compvars(PCOMPVARS pc)
{ {
heap_free(pc->lpbiIn); free(pc->lpbiIn);
heap_free(pc->lpBitsPrev); free(pc->lpBitsPrev);
heap_free(pc->lpBitsOut); free(pc->lpBitsOut);
heap_free(pc->lpState); free(pc->lpState);
pc->lpbiIn = pc->lpBitsPrev = pc->lpBitsOut = pc->lpState = NULL; pc->lpbiIn = pc->lpBitsPrev = pc->lpBitsOut = pc->lpState = NULL;
if (pc->dwFlags & 0x80000000) if (pc->dwFlags & 0x80000000)
{ {
heap_free(pc->lpbiOut); free(pc->lpbiOut);
pc->lpbiOut = NULL; pc->lpbiOut = NULL;
pc->dwFlags &= ~0x80000000; pc->dwFlags &= ~0x80000000;
} }
...@@ -1521,7 +1520,7 @@ static BITMAPINFO *copy_bitmapinfo(const BITMAPINFO *src) ...@@ -1521,7 +1520,7 @@ static BITMAPINFO *copy_bitmapinfo(const BITMAPINFO *src)
if (src->bmiHeader.biCompression == BI_BITFIELDS) if (src->bmiHeader.biCompression == BI_BITFIELDS)
size += 3 * sizeof(DWORD); size += 3 * sizeof(DWORD);
if (!(dst = heap_alloc(size))) if (!(dst = malloc(size)))
return NULL; return NULL;
memcpy(dst, src, size); memcpy(dst, src, size);
...@@ -1542,7 +1541,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn) ...@@ -1542,7 +1541,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
if (!(pc->lpbiIn = copy_bitmapinfo(lpbiIn))) if (!(pc->lpbiIn = copy_bitmapinfo(lpbiIn)))
return FALSE; return FALSE;
if (!(pc->lpState = heap_alloc(sizeof(ICCOMPRESS) + sizeof(*icComp->lpckid) + sizeof(*icComp->lpdwFlags)))) if (!(pc->lpState = malloc(sizeof(ICCOMPRESS) + sizeof(*icComp->lpckid) + sizeof(*icComp->lpdwFlags))))
goto error; goto error;
pc->cbState = sizeof(ICCOMPRESS); pc->cbState = sizeof(ICCOMPRESS);
...@@ -1555,7 +1554,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn) ...@@ -1555,7 +1554,7 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
if (size <= 0) if (size <= 0)
goto error; goto error;
if (!(pc->lpbiOut = heap_alloc_zero(size))) if (!(pc->lpbiOut = calloc(1, size)))
goto error; goto error;
/* Flag to show that we allocated lpbiOut for proper cleanup */ /* Flag to show that we allocated lpbiOut for proper cleanup */
pc->dwFlags |= 0x80000000; pc->dwFlags |= 0x80000000;
...@@ -1591,11 +1590,11 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn) ...@@ -1591,11 +1590,11 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
pc->lpbiOut->bmiHeader.biSizeImage); pc->lpbiOut->bmiHeader.biSizeImage);
/* Buffer for compressed frame data */ /* Buffer for compressed frame data */
if (!(pc->lpBitsOut = heap_alloc(pc->lpbiOut->bmiHeader.biSizeImage))) if (!(pc->lpBitsOut = malloc(pc->lpbiOut->bmiHeader.biSizeImage)))
goto error; goto error;
/* Buffer for previous compressed frame data */ /* Buffer for previous compressed frame data */
if (!(pc->lpBitsPrev = heap_alloc(pc->lpbiOut->bmiHeader.biSizeImage))) if (!(pc->lpBitsPrev = malloc(pc->lpbiOut->bmiHeader.biSizeImage)))
goto error; goto error;
TRACE("Compvars:\n" TRACE("Compvars:\n"
......
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