From a8a3e227939cb3463553c9857d051133820ae011 Mon Sep 17 00:00:00 2001
From: Steve Melenchuk <smelenchuk@gmail.com>
Date: Sat, 7 Oct 2017 18:33:16 -0600
Subject: [PATCH] d3d11: Allow NULL pointer for initial count in
 d3d11_deferred_context_CSSetUnorderedAccessViews.

---
 dlls/d3d11/device.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index e214202..a011114 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -5659,12 +5659,13 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_CSSetUnorderedAccessViews(I
     call->unordered_view.start_slot = start_slot;
     call->unordered_view.num_views = view_count;
     call->unordered_view.views = (void *)(call + 1);
-    call->unordered_view.initial_counts = (void *)&call->unordered_view.views[view_count];
+    call->unordered_view.initial_counts = initial_counts ?
+        (void *)&call->unordered_view.views[view_count] : NULL;
     for (i = 0; i < view_count; i++)
     {
         if (views[i]) ID3D11UnorderedAccessView_AddRef(views[i]);
         call->unordered_view.views[i] = views[i];
-        call->unordered_view.initial_counts[i] = initial_counts[i];
+        if (initial_counts) call->unordered_view.initial_counts[i] = initial_counts[i];
     }
 }
 
-- 
1.9.1

