mirror of https://github.com/mpv-player/mpv
misc/random: set constant seed for fuzzing
Fuzzing expect deterministic behavior. While we don't use this random generator for anything significant, still good to set the seed, in case of future usage.
This commit is contained in:
parent
799137a87c
commit
a949e0c2d5
|
@ -41,6 +41,9 @@ static inline uint64_t splitmix64(uint64_t *const x)
|
|||
|
||||
void mp_rand_seed(uint64_t seed)
|
||||
{
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
seed = 42;
|
||||
#endif
|
||||
mp_mutex_lock(&state_mutex);
|
||||
state[0] = seed;
|
||||
for (int i = 1; i < 4; i++)
|
||||
|
|
Loading…
Reference in New Issue