mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
adding more check
svn path=/trunk/; revision=26753
This commit is contained in:
parent
393d729ca1
commit
85c06f6f40
|
@ -34,11 +34,19 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
|
||||||
/* check if pDDSD.dwFlags DDSD_LPSURFACE is set or not */
|
/* check if pDDSD.dwFlags DDSD_LPSURFACE is set or not */
|
||||||
if (pDDSD->dwFlags & DDSD_LPSURFACE)
|
if (pDDSD->dwFlags & DDSD_LPSURFACE)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (pDDSD->ddsCaps.dwCaps & ( DDSCAPS_COMPLEX | DDSCAPS_RESERVED2 | DDSCAPS_RESERVED3 |
|
||||||
|
DDSCAPS_VIDEOPORT | DDSCAPS_PRIMARYSURFACE | DDSCAPS_OVERLAY ))
|
||||||
|
{
|
||||||
|
return DDERR_INVALIDCAPS;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DDSD_LPSURFACE flag is set now we start vaildate see if
|
* DDSD_LPSURFACE flag is set now we start vaildate see if
|
||||||
* pDDSD->lpSurface are a pointer or not
|
* pDDSD->lpSurface are a pointer or not
|
||||||
*/
|
*/
|
||||||
if (IsBadReadPtr(pDDSD->lpSurface,sizeof(LPVOID)))
|
if (IsBadReadPtr(pDDSD->lpSurface,sizeof(LPVOID)) ||
|
||||||
|
(pDDSD->dwFlags - (pDDSD->dwFlags & DDSD_ALL)))
|
||||||
{
|
{
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue