From b7feca59c4aa0249913e9549bd5810f12cc913b5 Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Tue, 17 Mar 2026 23:29:31 +0800 Subject: [PATCH] fix(test): zero-initialize state structs to avoid stack corruption --- tests/RHI/OpenGL/test_command_list.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/RHI/OpenGL/test_command_list.cpp b/tests/RHI/OpenGL/test_command_list.cpp index a310ff7f..97c99b14 100644 --- a/tests/RHI/OpenGL/test_command_list.cpp +++ b/tests/RHI/OpenGL/test_command_list.cpp @@ -150,7 +150,7 @@ TEST_F(OpenGLTestFixture, CommandList_SetPrimitiveTopology) { TEST_F(OpenGLTestFixture, CommandList_SetDepthStencilState) { OpenGLCommandList cmdList; - DepthStencilState state; + DepthStencilState state = {}; state.depthEnable = true; state.depthWriteMask = true; state.depthFunc = ComparisonFunc::Less; @@ -165,7 +165,7 @@ TEST_F(OpenGLTestFixture, CommandList_SetDepthStencilState) { TEST_F(OpenGLTestFixture, CommandList_SetBlendState) { OpenGLCommandList cmdList; - BlendState state; + BlendState state = {}; state.renderTargets[0].blendEnable = true; state.renderTargets[0].srcBlend = BlendFactor::SrcAlpha; state.renderTargets[0].dstBlend = BlendFactor::InvSrcAlpha;