Add a check for icinfo->fccType in DRV_OPEN message handler of builtin
video codecs.
This commit is contained in:
parent
de60d1e3bc
commit
c13ae56289
|
@ -961,7 +961,13 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case DRV_OPEN:
|
case DRV_OPEN:
|
||||||
|
{
|
||||||
|
ICINFO *icinfo = (ICINFO *)lParam2;
|
||||||
|
|
||||||
TRACE("Opened\n");
|
TRACE("Opened\n");
|
||||||
|
|
||||||
|
if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
|
||||||
|
|
||||||
info = ICCVID_Alloc( sizeof (ICCVID_Info), 1 );
|
info = ICCVID_Alloc( sizeof (ICCVID_Info), 1 );
|
||||||
if( info )
|
if( info )
|
||||||
{
|
{
|
||||||
|
@ -969,6 +975,7 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
|
||||||
info->cvinfo = NULL;
|
info->cvinfo = NULL;
|
||||||
}
|
}
|
||||||
return (LRESULT) info;
|
return (LRESULT) info;
|
||||||
|
}
|
||||||
|
|
||||||
case ICM_GETINFO:
|
case ICM_GETINFO:
|
||||||
return ICCVID_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
|
return ICCVID_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
|
||||||
|
|
|
@ -1099,6 +1099,8 @@ static CodecInfo* Open(LPICOPEN icinfo)
|
||||||
return (LPVOID)0xFFFF0000;
|
return (LPVOID)0xFFFF0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (icinfo->fccType != ICTYPE_VIDEO) return NULL;
|
||||||
|
|
||||||
TRACE("(%p = {%lu,0x%08lX(%4.4s),0x%08lX(%4.4s),0x%lX,0x%lX,...})\n", icinfo,
|
TRACE("(%p = {%lu,0x%08lX(%4.4s),0x%08lX(%4.4s),0x%lX,0x%lX,...})\n", icinfo,
|
||||||
icinfo->dwSize, icinfo->fccType, (char*)&icinfo->fccType,
|
icinfo->dwSize, icinfo->fccType, (char*)&icinfo->fccType,
|
||||||
icinfo->fccHandler, (char*)&icinfo->fccHandler,
|
icinfo->fccHandler, (char*)&icinfo->fccHandler,
|
||||||
|
|
|
@ -497,7 +497,13 @@ LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRV_OPEN:
|
case DRV_OPEN:
|
||||||
|
{
|
||||||
|
ICINFO *icinfo = (ICINFO *)lParam2;
|
||||||
|
|
||||||
TRACE("Opened\n");
|
TRACE("Opened\n");
|
||||||
|
|
||||||
|
if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
|
||||||
|
|
||||||
info = HeapAlloc( GetProcessHeap(), 0, sizeof (Msvideo1Context) );
|
info = HeapAlloc( GetProcessHeap(), 0, sizeof (Msvideo1Context) );
|
||||||
if( info )
|
if( info )
|
||||||
{
|
{
|
||||||
|
@ -506,6 +512,7 @@ LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
|
||||||
}
|
}
|
||||||
r = (LRESULT) info;
|
r = (LRESULT) info;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case ICM_GETINFO:
|
case ICM_GETINFO:
|
||||||
r = CRAM_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
|
r = CRAM_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
|
||||||
|
|
|
@ -400,7 +400,7 @@ HIC MSVIDEO_OpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode,
|
||||||
icopen.dwSize = sizeof(ICOPEN);
|
icopen.dwSize = sizeof(ICOPEN);
|
||||||
icopen.fccType = fccType;
|
icopen.fccType = fccType;
|
||||||
icopen.fccHandler = fccHandler;
|
icopen.fccHandler = fccHandler;
|
||||||
icopen.dwVersion = 0x00001000; /* FIXME */
|
icopen.dwVersion = ICVERSION;
|
||||||
icopen.dwFlags = wMode;
|
icopen.dwFlags = wMode;
|
||||||
icopen.dwError = 0;
|
icopen.dwError = 0;
|
||||||
icopen.pV1Reserved = NULL;
|
icopen.pV1Reserved = NULL;
|
||||||
|
|
Loading…
Reference in New Issue