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:
Filip Gawin 2021-10-23 16:59:13 +02:00 committed by Marge Bot
parent 8eae431720
commit 57969c6dad

View file

@ -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;