DDraw: remove an incorrect size check

Stefan Dösinger stefandoesinger at gmx.at
Thu Oct 12 12:31:01 CDT 2006


desc2 is a local DDSURFACEDESC2 variable in the function, not passed by an 
app, so we can be sure that ddscaps.dwCaps2 exists. Set the 
DDCAPS2_MIPMAPSUBLEVEL flag always in desc2(and thus in the surface), an 
ddraw7 app may pass a DDSURFACEDESC (not 2) struct and still expect 
DDSCAPS2_MIPMAPSUBLEVEL set.

The other size check when removing the DDSCAPS2_MIPMAPSUBLEVEL flag from the 
structure passed by the app is correct.
-------------- next part --------------
From b66d21040069f55dd1483c7bfc52807dc6fef31d Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Thu, 12 Oct 2006 19:25:12 +0200
Subject: [PATCH] DDraw: Remove a size check
---
 dlls/ddraw/ddraw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 667d5c2..fc19b3a 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2398,7 +2398,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)&&(DDSD->dwSize >= sizeof(DDSURFACEDESC2)))
+    if(DDSD->ddsCaps.dwCaps & DDSCAPS_MIPMAP)
     {
         desc2.ddsCaps.dwCaps2 |= DDSCAPS2_MIPMAPSUBLEVEL;
     }
-- 
1.4.1.1



More information about the wine-patches mailing list