diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index a5dae19e..d7c80163 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2509,7 +2509,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_constant(struct vkd3d_dxbc_compile const struct vkd3d_shader_register *reg, DWORD swizzle, DWORD write_mask) { unsigned int component_count = vkd3d_write_mask_component_count(write_mask); - uint32_t values[VKD3D_VEC4_SIZE]; + uint32_t values[VKD3D_VEC4_SIZE] = {0}; unsigned int i, j; assert(reg->type == VKD3DSPR_IMMCONST); diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index 83ccd3d6..5fe4540c 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -46,7 +46,7 @@ static bool read_shader(struct vkd3d_shader_code *shader, const char *filename) return false; } - if (!(code = malloc(sizeof(uint32_t) * shader->size))) + if (!(code = malloc(shader->size))) { fprintf(stderr, "Out of memory.\n"); fclose(fd);