=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Do not crash when attempting to issue draw call with no attachments.

Alexandre Julliard julliard at winehq.org
Mon Feb 27 15:12:08 CST 2017


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Sun Feb 26 18:48:04 2017 +0100

wined3d: Do not crash when attempting to issue draw call with no attachments.

The is broken since by 2641c5c28f407fb157028c8e7dda5e306b6b313c.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/drawprim.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 48421ef..4cb19e1 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -427,7 +427,10 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
 
     if (!(rtv = fb->render_targets[0]))
         rtv = fb->depth_stencil;
-    context = context_acquire(device, wined3d_texture_from_resource(rtv->resource), rtv->sub_resource_idx);
+    if (rtv)
+        context = context_acquire(device, wined3d_texture_from_resource(rtv->resource), rtv->sub_resource_idx);
+    else
+        context = context_acquire(device, NULL, 0);
     if (!context->valid)
     {
         context_release(context);




More information about the wine-cvs mailing list