winmm: Handle NULL szFileName in mmioOpen16 (Coverity).

This commit is contained in:
Marcus Meissner 2009-10-17 16:00:44 +01:00 committed by Alexandre Julliard
parent 1ae601772c
commit 8ba51495fc
1 changed files with 2 additions and 0 deletions

View File

@ -598,6 +598,8 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
if (dwOpenFlags & (MMIO_PARSE|MMIO_EXIST)) {
char buffer[MAX_PATH];
if (!szFileName)
return (HMMIO)FALSE;
if (GetFullPathNameA(szFileName, sizeof(buffer), buffer, NULL) >= sizeof(buffer))
return (HMMIO)FALSE;
if ((dwOpenFlags & MMIO_EXIST) && (GetFileAttributesA(buffer) == INVALID_FILE_ATTRIBUTES))