Module: wine Branch: master Commit: 52296dbdbf5b2137f19ae0582bab6bcba2317bdb URL: http://source.winehq.org/git/wine.git/?a=commit;h=52296dbdbf5b2137f19ae0582b...
Author: Jesse Allen the3dfxdude@gmail.com Date: Tue Oct 10 09:06:28 2006 -0700
ddraw: Fix for DDSURFACEDESC param in CreateSurface.
---
dlls/ddraw/ddraw.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 341d936..5b72aa5 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2136,7 +2136,8 @@ IDirectDrawImpl_CreateSurface(IDirectDra }
/* 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 */ memset(&desc2, 0, sizeof(desc2)); @@ -2314,7 +2315,7 @@ IDirectDrawImpl_CreateSurface(IDirectDra desc2.ddsCaps.dwCaps |= DDSCAPS_BACKBUFFER; } /* 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; }