From ef0fee48c4beb29b2b020117c050020ea0c76d1f Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Thu, 20 Aug 2020 17:06:39 +0000 Subject: [PATCH] D3D12: check if resource manager exists before releasing ClusterFuzz injects errors into the device which may not initialize the resource manager which would later fail upon shutdown. This adds a check to see if the resource manager exists before releasing the pool. BUG=chromium:1117595 Change-Id: Ie2b90f947f3ddd3906ecabc65e959915c1f7e386 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27040 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Rafael Cintron Commit-Queue: Bryan Bernhart --- src/dawn_native/d3d12/DeviceD3D12.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp index c199bcee54..295548e701 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.cpp +++ b/src/dawn_native/d3d12/DeviceD3D12.cpp @@ -571,7 +571,9 @@ namespace dawn_native { namespace d3d12 { } // Release recycled resource heaps. - mResourceAllocatorManager->DestroyPool(); + if (mResourceAllocatorManager != nullptr) { + mResourceAllocatorManager->DestroyPool(); + } // We need to handle clearing up com object refs that were enqeued after TickImpl mUsedComObjectRefs.ClearUpTo(std::numeric_limits::max());