mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Avoid a null pointer dereference in hlsl_block_cleanup (UBSan).
destroy_block() is called with a NULL block from: * create_loop, through the loop rules for while and do-while loops. * The selection_statement rule, in the case $6.else_block is NULL. * free_parse_initializer.
This commit is contained in:
parent
98f73ca2e5
commit
c9af34ab28
Notes:
Alexandre Julliard
2024-05-14 23:00:02 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Elizabeth Figura (@zfigura) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/854
@ -168,6 +168,9 @@ static struct list *make_empty_list(struct hlsl_ctx *ctx)
|
||||
|
||||
static void destroy_block(struct hlsl_block *block)
|
||||
{
|
||||
if (!block)
|
||||
return;
|
||||
|
||||
hlsl_block_cleanup(block);
|
||||
vkd3d_free(block);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user