mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader: Avoid passing NULL to qsort(). (ubsan)
Otherwise ubsan reports runtime errors such as: libs/vkd3d-shader/ir.c:4731:5: runtime error: null pointer passed as argument 1, which is declared to never be null
This commit is contained in:
parent
eaf4d0bfbf
commit
7b23cd4d3c
Notes:
Henri Verbeet
2025-01-10 20:15:12 +01:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1327
@ -10280,7 +10280,8 @@ struct extern_resource *sm4_get_extern_resources(struct hlsl_ctx *ctx, unsigned
|
||||
++*count;
|
||||
}
|
||||
|
||||
qsort(extern_resources, *count, sizeof(*extern_resources), sm4_compare_extern_resources);
|
||||
if (extern_resources)
|
||||
qsort(extern_resources, *count, sizeof(*extern_resources), sm4_compare_extern_resources);
|
||||
|
||||
return extern_resources;
|
||||
}
|
||||
|
@ -4775,7 +4775,8 @@ static enum vkd3d_result vsir_cfg_generate_synthetic_loop_intervals(struct vsir_
|
||||
}
|
||||
}
|
||||
|
||||
qsort(cfg->loop_intervals, cfg->loop_interval_count, sizeof(*cfg->loop_intervals), compare_loop_intervals);
|
||||
if (cfg->loop_intervals)
|
||||
qsort(cfg->loop_intervals, cfg->loop_interval_count, sizeof(*cfg->loop_intervals), compare_loop_intervals);
|
||||
|
||||
if (TRACE_ON())
|
||||
for (i = 0; i < cfg->loop_interval_count; ++i)
|
||||
|
@ -578,8 +578,9 @@ static HRESULT d3d12_root_signature_info_from_desc(struct d3d12_root_signature_i
|
||||
goto done;
|
||||
}
|
||||
|
||||
qsort(info->ranges, info->range_count, sizeof(*info->ranges),
|
||||
d3d12_root_signature_info_range_compare);
|
||||
if (info->ranges)
|
||||
qsort(info->ranges, info->range_count, sizeof(*info->ranges),
|
||||
d3d12_root_signature_info_range_compare);
|
||||
|
||||
for (i = D3D12_SHADER_VISIBILITY_VERTEX; i <= D3D12_SHADER_VISIBILITY_MESH; ++i)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user