diff --git a/dlls/gdi/mfdrv/init.c b/dlls/gdi/mfdrv/init.c index ca4d45f1363..6097127e22e 100644 --- a/dlls/gdi/mfdrv/init.c +++ b/dlls/gdi/mfdrv/init.c @@ -263,6 +263,8 @@ HDC WINAPI CreateMetaFileW(LPCWSTR filename) DWORD len; HDC hReturnDC; + if (!filename) return CreateMetaFileA(NULL); + len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL ); filenameA = HeapAlloc( GetProcessHeap(), 0, len ); WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL );