From 6a03369f84735a5b2c5c562ed01495c6826e3eb3 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Sat, 19 Oct 2024 20:59:56 +0200 Subject: [PATCH] vkd3d-shader: Do not dump the target shader if compilation failed. Otherwise we'd use unitialized data. --- libs/vkd3d-shader/vkd3d_shader_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 0d577cf1..694dfa6f 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -1746,7 +1746,8 @@ int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, } } - vkd3d_shader_dump_shader(&dump_data, out->code, out->size, false); + if (ret >= 0) + vkd3d_shader_dump_shader(&dump_data, out->code, out->size, false); vkd3d_shader_message_context_trace_messages(&message_context); if (!vkd3d_shader_message_context_copy_messages(&message_context, messages))