Author: greatlrd
Date: Sun May 13 17:14:54 2007
New Revision: 26753
URL:
http://svn.reactos.org/svn/reactos?rev=26753&view=rev
Log:
adding more check
Modified:
trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
Modified: trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/createsurface.c (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/createsurface.c Sun May 13 17:14:54 2007
@@ -34,11 +34,19 @@
/* check if pDDSD.dwFlags DDSD_LPSURFACE is set or not */
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
* 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;
}