Henri Verbeet : wined3d: Enforce map access on all resources.

Alexandre Julliard julliard at winehq.org
Wed Feb 14 15:12:09 CST 2018


Module: wine
Branch: master
Commit: 7772c4fdbf33507b2262da375b465d4c2cbc316d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7772c4fdbf33507b2262da375b465d4c2cbc316d

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Feb 14 10:27:55 2018 +0330

wined3d: Enforce map access on all resources.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/resource.c | 6 ++++++
 dlls/wined3d/texture.c  | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index e318888..3b07e0c 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -346,6 +346,12 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
     TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n",
             resource, sub_resource_idx, map_desc, debug_box(box), flags);
 
+    if (!(resource->access & WINED3D_RESOURCE_ACCESS_MAP))
+    {
+        WARN("Resource is not mappable.\n");
+        return WINED3DERR_INVALIDCALL;
+    }
+
     flags = wined3d_resource_sanitise_map_flags(resource, flags);
     wined3d_resource_wait_idle(resource);
 
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c9210cb..dd6a2dd 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1897,12 +1897,6 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
             return WINED3DERR_INVALIDCALL;
     }
 
-    if (!(resource->access & WINED3D_RESOURCE_ACCESS_MAP))
-    {
-        WARN("Trying to map unmappable texture.\n");
-        return WINED3DERR_INVALIDCALL;
-    }
-
     if (texture->flags & WINED3D_TEXTURE_DC_IN_USE)
     {
         WARN("DC is in use.\n");




More information about the wine-cvs mailing list