[PATCH v2 3/5] wined3d: Do not copy surface region when empty box is passed.

Józef Kucia jkucia at codeweavers.com
Wed Jan 20 15:08:21 CST 2016


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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e5cf25c..0497f06 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4006,6 +4006,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
     dst_rect.top = dst_y;
     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