From 57fd362fe1cc72d9b0365779a95fac5877a9bf16 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Thu, 21 Oct 2021 19:46:05 +0300 Subject: [PATCH] Prevent shader crash when passing constant expression to `textureGather` --- servers/rendering/shader_language.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 9c38bf76063..53f2d96f52c 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -2763,6 +2763,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, const FunctionI bool is_const = false; ConstantNode::Value value; + value.sint = -1; _find_identifier(p_block, false, p_function_info, vn->name, nullptr, nullptr, &is_const, nullptr, nullptr, &value); if (!is_const || value.sint < min || value.sint > max) {