Commit 52296dbd authored by Jesse Allen's avatar Jesse Allen Committed by Alexandre Julliard

ddraw: Fix for DDSURFACEDESC param in CreateSurface.

parent 9c6c8b17
...@@ -2136,7 +2136,8 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface, ...@@ -2136,7 +2136,8 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
} }
/* According to the msdn this flag is ignored by CreateSurface */ /* According to the msdn this flag is ignored by CreateSurface */
DDSD->ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL; if (DDSD->dwSize >= sizeof(DDSURFACEDESC2))
DDSD->ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL;
/* Modify some flags */ /* Modify some flags */
memset(&desc2, 0, sizeof(desc2)); memset(&desc2, 0, sizeof(desc2));
...@@ -2314,7 +2315,7 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface, ...@@ -2314,7 +2315,7 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
desc2.ddsCaps.dwCaps |= DDSCAPS_BACKBUFFER; desc2.ddsCaps.dwCaps |= DDSCAPS_BACKBUFFER;
} }
/* Set the DDSCAPS2_MIPMAPSUBLEVEL flag on mipmap sublevels according to the msdn */ /* Set the DDSCAPS2_MIPMAPSUBLEVEL flag on mipmap sublevels according to the msdn */
if(DDSD->ddsCaps.dwCaps & DDSCAPS_MIPMAP) if((DDSD->ddsCaps.dwCaps & DDSCAPS_MIPMAP)&&(DDSD->dwSize >= sizeof(DDSURFACEDESC2)))
{ {
desc2.ddsCaps.dwCaps2 |= DDSCAPS2_MIPMAPSUBLEVEL; desc2.ddsCaps.dwCaps2 |= DDSCAPS2_MIPMAPSUBLEVEL;
} }
......
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