From 52cbc802a1e5c390690ec57f50b8b5c0fadaa3b5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 4 Jan 2017 16:55:29 +0000 Subject: [PATCH] Fix crash if D3D12 capture has no initial states at all * Located via a crash report - if there are no initial states in a capture at all, then initStateCurList will still be NULL after trying to apply them. --- renderdoc/driver/d3d12/d3d12_device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index ffefe1a60..2f9dd2331 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -537,7 +537,8 @@ void WrappedID3D12Device::ApplyInitialContents() GetResourceManager()->ApplyInitialContents(); // close the final list - initStateCurList->Close(); + if(initStateCurList) + initStateCurList->Close(); initStateCurBatch = 0; initStateCurList = NULL;