From 1a122c0a7117b7bc47951cd5dfaa7570a828b7ca Mon Sep 17 00:00:00 2001 From: Joachim Reichel <43646584+jreichel-nvidia@users.noreply.github.com> Date: Tue, 21 Jul 2026 13:30:09 +0200 Subject: [PATCH] Fix crash if a sampling node does not have an input with the expected name. --- source/MaterialXGenMdl/Nodes/ConvolutionNode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/MaterialXGenMdl/Nodes/ConvolutionNode.cpp b/source/MaterialXGenMdl/Nodes/ConvolutionNode.cpp index e9e97c0e23..02a8c8e0dd 100644 --- a/source/MaterialXGenMdl/Nodes/ConvolutionNode.cpp +++ b/source/MaterialXGenMdl/Nodes/ConvolutionNode.cpp @@ -86,12 +86,12 @@ const ShaderInput* ConvolutionNode::getSamplingInput(const ShaderNode& node) con if (node.hasClassification(ShaderNode::Classification::SAMPLE2D)) { const ShaderInput* input = node.getInput(SAMPLE2D_INPUT); - return input->getType() == Type::VECTOR2 ? input : nullptr; + return input && input->getType() == Type::VECTOR2 ? input : nullptr; } else if (node.hasClassification(ShaderNode::Classification::SAMPLE3D)) { const ShaderInput* input = node.getInput(SAMPLE3D_INPUT); - return input->getType() == Type::VECTOR3 ? input : nullptr; + return input && input->getType() == Type::VECTOR3 ? input : nullptr; } return nullptr; }