Commit 39d013c6 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

MCIWndCreateA: check for NULL filename.

parent 83d6efb7
......@@ -90,7 +90,10 @@ HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
if (!mwi) return 0;
mwi->dwStyle = dwStyle;
mwi->lpName = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(szFile) + 1), szFile);
if (szFile)
mwi->lpName = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(szFile) + 1), szFile);
else
mwi->lpName = NULL;
mwi->uTimer = 0;
wndStyle = ((hwndParent) ? (WS_CHILD|WS_BORDER) : WS_OVERLAPPEDWINDOW) |
......@@ -102,7 +105,7 @@ HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
hwndParent, (HMENU)0, hInstance, mwi))
return mwi->hWnd;
HeapFree(GetProcessHeap(), 0, mwi->lpName);
if(mwi->lpName) HeapFree(GetProcessHeap(), 0, mwi->lpName);
HeapFree(GetProcessHeap(), 0, mwi);
return 0;
}
......
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