[5/7] DDraw: Do not allow the surface dimensions to fall to 0

Stefan Dösinger stefandoesinger at gmx.at
Fri Oct 13 04:04:55 CDT 2006


The same patch as yesterday, applies cleanly now
-------------- next part --------------
From cf7328dbaf005228f016291a755c8a8f115f94d2 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Fri, 13 Oct 2006 10:53:13 +0200
Subject: [PATCH] DDraw: Do not allow the surface dimensions to fall to 0
---
 dlls/ddraw/ddraw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 1dc3bfb..8d03b91 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2409,8 +2409,8 @@ IDirectDrawImpl_CreateSurface(IDirectDra
         if(DDSD->ddsCaps.dwCaps & DDSCAPS_MIPMAP)
         {
             level++;
-            desc2.dwWidth /= 2;
-            desc2.dwHeight /= 2;
+            if(desc2.dwWidth > 1) desc2.dwWidth /= 2;
+            if(desc2.dwHeight > 1) desc2.dwHeight /= 2;
         }
 
         DDOBJ_LOCK(This);
-- 
1.4.1.1



More information about the wine-patches mailing list