[PATCH 6/6] wined3d: Do not crash when attempting to issue draw call with no attachments.

Józef Kucia jkucia at codeweavers.com
Sun Feb 26 11:48:04 CST 2017


The is broken since by 2641c5c28f407fb157028c8e7dda5e306b6b313c.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 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);
-- 
2.10.2




More information about the wine-patches mailing list