diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 244a63a0..c06741c5 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -22,6 +22,7 @@ #include "sm4.h" #define SM4_MAX_SRC_COUNT 6 +#define SM4_MAX_DST_COUNT 2 STATIC_ASSERT(SM4_MAX_SRC_COUNT <= SPIRV_MAX_SRC_COUNT); @@ -96,7 +97,7 @@ struct vkd3d_shader_sm4_parser unsigned int output_map[MAX_REG_OUTPUT]; struct vkd3d_shader_src_param src_param[SM4_MAX_SRC_COUNT]; - struct vkd3d_shader_dst_param dst_param[2]; + struct vkd3d_shader_dst_param dst_param[SM4_MAX_DST_COUNT]; struct list src_free; struct list src; struct vkd3d_shader_immediate_constant_buffer icb; @@ -108,7 +109,7 @@ struct vkd3d_sm4_opcode_info { enum vkd3d_sm4_opcode opcode; enum vkd3d_shader_opcode handler_idx; - const char *dst_info; + char dst_info[SM4_MAX_DST_COUNT]; char src_info[SM4_MAX_SRC_COUNT]; void (*read_opcode_func)(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv); @@ -1518,7 +1519,7 @@ static void shader_sm4_read_instruction(struct vkd3d_shader_parser *parser, stru ins->raw = false; ins->structured = false; ins->predicate = NULL; - ins->dst_count = strlen(opcode_info->dst_info); + ins->dst_count = strnlen(opcode_info->dst_info, SM4_MAX_DST_COUNT); ins->dst = sm4->dst_param; ins->src_count = strnlen(opcode_info->src_info, SM4_MAX_SRC_COUNT); ins->src = sm4->src_param;