mciavi32: Removed duplicate strlen/NULL check (Coverity).

This commit is contained in:
Marcus Meissner 2009-11-08 10:24:32 +01:00 committed by Alexandre Julliard
parent 25bfe9df49
commit 961e88f756
1 changed files with 15 additions and 18 deletions

View File

@ -250,12 +250,10 @@ static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags,
* contains the hFile value ?
*/
dwRet = MCIERR_UNRECOGNIZED_COMMAND;
} else if (strlenW(lpOpenParms->lpstrElementName) > 0) {
} else if (lpOpenParms->lpstrElementName && lpOpenParms->lpstrElementName[0]) {
/* FIXME : what should be done id wma->hFile is already != 0, or the driver is playin' */
TRACE("MCI_OPEN_ELEMENT %s!\n", debugstr_w(lpOpenParms->lpstrElementName));
if (lpOpenParms->lpstrElementName && (strlenW(lpOpenParms->lpstrElementName) > 0))
{
wma->lpFileName = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpOpenParms->lpstrElementName) + 1) * sizeof(WCHAR));
strcpyW(wma->lpFileName, lpOpenParms->lpstrElementName);
@ -273,7 +271,6 @@ static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags,
else if (!MCIAVI_CreateWindow(wma, dwFlags, lpOpenParms))
dwRet = MCIERR_CREATEWINDOW;
}
}
} else {
FIXME("Don't record yet\n");
dwRet = MCIERR_UNSUPPORTED_FUNCTION;