Henri Verbeet : ddraw: Clamp video memory to UINT_MAX in ddraw7_GetAvailableVidMem().

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 18 16:08:48 CDT 2014


Module: wine
Branch: master
Commit: 1fb7ccdc1351d00ea64f20e1d5f914bd4848bdba
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1fb7ccdc1351d00ea64f20e1d5f914bd4848bdba

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Aug 18 08:26:17 2014 +0200

ddraw: Clamp video memory to UINT_MAX in ddraw7_GetAvailableVidMem().

---

 dlls/ddraw/ddraw.c         | 2 +-
 dlls/ddraw/ddraw_private.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index df74122..5f0070a 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1926,7 +1926,7 @@ static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *C
         struct wined3d_adapter_identifier desc = {0};
 
         hr = wined3d_get_adapter_identifier(ddraw->wined3d, WINED3DADAPTER_DEFAULT, 0, &desc);
-        *total = desc.video_memory;
+        *total = min(UINT_MAX, desc.video_memory);
     }
 
     wined3d_mutex_unlock();
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index f5248cc..374c273 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -20,6 +20,7 @@
 #define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
 
 #include <assert.h>
+#include <limits.h>
 #define COBJMACROS
 #define NONAMELESSSTRUCT
 #define NONAMELESSUNION




More information about the wine-cvs mailing list