[PATCH 4/6] wined3d: Enforce volume mapping restrictions

Stefan Dösinger stefan at codeweavers.com
Thu Aug 22 16:22:48 CDT 2013


---
 dlls/wined3d/volume.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 71b2937..0369f54 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -373,6 +373,13 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
     TRACE("volume %p, map_desc %p, box %p, flags %#x.\n",
             volume, map_desc, box, flags);
 
+    if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
+    {
+        WARN("Volume %p is not CPU accessible.\n", volume);
+        map_desc->data = NULL;
+        return WINED3DERR_INVALIDCALL;
+    }
+
     if (!volume_prepare_system_memory(volume))
     {
         WARN("Out of memory.\n");
-- 
1.8.1.5




More information about the wine-patches mailing list