Commit c13ae562 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Add a check for icinfo->fccType in DRV_OPEN message handler of builtin

video codecs.
parent de60d1e3
......@@ -961,7 +961,13 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
return 0;
case DRV_OPEN:
{
ICINFO *icinfo = (ICINFO *)lParam2;
TRACE("Opened\n");
if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
info = ICCVID_Alloc( sizeof (ICCVID_Info), 1 );
if( info )
{
......@@ -969,6 +975,7 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
info->cvinfo = NULL;
}
return (LRESULT) info;
}
case ICM_GETINFO:
return ICCVID_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
......
......@@ -1099,6 +1099,8 @@ static CodecInfo* Open(LPICOPEN icinfo)
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,
icinfo->dwSize, icinfo->fccType, (char*)&icinfo->fccType,
icinfo->fccHandler, (char*)&icinfo->fccHandler,
......
......@@ -497,7 +497,13 @@ LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
break;
case DRV_OPEN:
{
ICINFO *icinfo = (ICINFO *)lParam2;
TRACE("Opened\n");
if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
info = HeapAlloc( GetProcessHeap(), 0, sizeof (Msvideo1Context) );
if( info )
{
......@@ -506,6 +512,7 @@ LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
}
r = (LRESULT) info;
break;
}
case ICM_GETINFO:
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.fccType = fccType;
icopen.fccHandler = fccHandler;
icopen.dwVersion = 0x00001000; /* FIXME */
icopen.dwVersion = ICVERSION;
icopen.dwFlags = wMode;
icopen.dwError = 0;
icopen.pV1Reserved = NULL;
......
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