[PATCH 1/5] wined3d: Avoid potential NULL pointer dereference (Coverity).

Józef Kucia jkucia at codeweavers.com
Thu Aug 31 02:04:34 CDT 2017


CID 1416674

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

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index bef47959c8..6ea2fd27a7 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1317,10 +1317,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con
     if (prev)
         InterlockedDecrement(&prev->resource->bind_count);
 
-    device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING(op->pipeline));
-
-    if (op->initial_count != ~0u)
+    if (op->view && op->initial_count != ~0u)
         wined3d_unordered_access_view_set_counter(op->view, op->initial_count);
+
+    device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING(op->pipeline));
 }
 
 void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline,
-- 
2.13.5




More information about the wine-patches mailing list