mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 16:18:06 +02:00
radv: dont call calloc when BVH is empty
Usage of pointer returned by calloc(0) is UB. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13503>
This commit is contained in:
parent
8eae431720
commit
57969c6dad
1 changed files with 3 additions and 0 deletions
|
|
@ -473,6 +473,9 @@ bvh_opt_compare(const void *_a, const void *_b)
|
|||
static void
|
||||
optimize_bvh(const char *base_ptr, uint32_t *node_ids, uint32_t node_count)
|
||||
{
|
||||
if (node_count == 0)
|
||||
return;
|
||||
|
||||
float bounds[6];
|
||||
for (unsigned i = 0; i < 3; ++i)
|
||||
bounds[i] = INFINITY;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue