Fix crash caused by trying to dereference a nullptr

Early return if input attachment is null (#6590)

Signed-off-by: amzn-sj <srikkant@amazon.com>
This commit is contained in:
amzn-sj
2022-01-03 11:50:49 -08:00
committed by GitHub
parent ece56055bf
commit 1d819e2591
@@ -101,6 +101,13 @@ namespace AZ
void EsmShadowmapsPass::UpdateChildren()
{
const RPI::PassAttachmentBinding& inputBinding = GetInputBinding(0);
if (!inputBinding.m_attachment)
{
AZ_Assert(false, "[EsmShadowmapsPass %s] requires an input attachment", GetPathName().GetCStr());
return;
}
AZ_Assert(inputBinding.m_attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[EsmShadowmapsPass %s] input attachment requires an image attachment", GetPathName().GetCStr());
m_shadowmapImageSize = inputBinding.m_attachment->m_descriptor.m_image.m_size;
m_shadowmapArraySize = inputBinding.m_attachment->m_descriptor.m_image.m_arraySize;