[ros-diffs] [greatlrd] 26753: adding more check
greatlrd at svn.reactos.org
greatlrd at svn.reactos.org
Sun May 13 15:14:55 CEST 2007
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/createsurface.c?rev=26753&r1=26752&r2=26753&view=diff
==============================================================================
--- 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;
}
More information about the Ros-diffs
mailing list