spa: audioconvert: ensure that noise::intesity is not too big

Shifting by 64 or more would not fit into `uint64_t`.
This commit is contained in:
Barnabás Pőcze 2022-06-24 16:20:55 +02:00
parent bb205d3d85
commit 1ac02db6a9

View file

@ -71,6 +71,9 @@ int noise_init(struct noise *ns)
if (info == NULL)
return -ENOTSUP;
if (ns->intensity >= 64)
return -EINVAL;
for (i = 0; i < SPA_N_ELEMENTS(ns->tab); i++)
ns->tab[i] = (drand48() - 0.5) / (UINT64_C(1) << ns->intensity);