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

video codecs.
This commit is contained in:
Dmitry Timoshkov 2006-02-03 12:29:26 +01:00 committed by Alexandre Julliard
parent de60d1e3bc
commit c13ae56289
4 changed files with 17 additions and 1 deletions

View File

@ -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 );

View File

@ -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,

View File

@ -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 );

View File

@ -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;