[PATCH 6/8] wined3d: Do not copy surface region when empty box is passed.

Józef Kucia jkucia at codeweavers.com
Tue Jan 19 15:28:10 CST 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/device.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 87221c3..c058881 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4004,6 +4004,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
 
     if (src_box)
     {
+        if (src_box->front >= src_box->back)
+        {
+            WARN("Invalid box (%u, %u, %u)->(%u, %u, %u) specified.\n",
+                    src_box->left, src_box->top, src_box->front,
+                    src_box->right, src_box->bottom, src_box->back);
+            return WINED3DERR_INVALIDCALL;
+        }
+
         src_rect.left = src_box->left;
         src_rect.top = src_box->top;
         src_rect.right = src_box->right;
-- 
2.4.10




More information about the wine-patches mailing list