Józef Kucia : wined3d: Do not crash when attempting to issue draw call with no attachments.
Module: wine Branch: master Commit: f4f2d4052b12ba15428cd9477b414b95e664857f URL: http://source.winehq.org/git/wine.git/?a=commit;h=f4f2d4052b12ba15428cd9477b... Author: Józef Kucia <jkucia(a)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(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)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);
participants (1)
-
Alexandre Julliard