mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/dxil: Handle sm6_parser_add_instruction() returning NULL.
Only calls to sm6_parser_add_instruction() where we are using the returned vkd3d_shader_instruction are checked for, since these return values might cause NULL dereferences if unchecked. Other calls to sm6_parser_add_instruction() can be left alone since the error is still recorded via sm6->p.status.
This commit is contained in:
committed by
Henri Verbeet
parent
bdba25d028
commit
aa943c51ea
Notes:
Henri Verbeet
2025-10-03 00:55:08 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1761
@@ -1368,6 +1368,13 @@ static inline bool vkd3d_shader_ver_le(const struct vkd3d_shader_version *v, uns
|
||||
void vsir_instruction_init(struct vkd3d_shader_instruction *ins,
|
||||
const struct vkd3d_shader_location *location, enum vkd3d_shader_opcode opcode);
|
||||
|
||||
static inline void vkd3d_shader_instruction_make_nop(struct vkd3d_shader_instruction *ins)
|
||||
{
|
||||
struct vkd3d_shader_location location = ins->location;
|
||||
|
||||
vsir_instruction_init(ins, &location, VSIR_OP_NOP);
|
||||
}
|
||||
|
||||
static inline bool vkd3d_shader_instruction_has_texel_offset(const struct vkd3d_shader_instruction *ins)
|
||||
{
|
||||
return ins->texel_offset.u || ins->texel_offset.v || ins->texel_offset.w;
|
||||
|
||||
Reference in New Issue
Block a user