diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 2b2985d446..d3975653a1 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -31,8 +31,9 @@ uint32_t ff_random_get_seed(void) if ((fd = open("/dev/random", O_RDONLY)) == -1) fd = open("/dev/urandom", O_RDONLY); if (fd != -1){ - read(fd, &seed, 4); + int err = read(fd, &seed, 4); close(fd); + if (err == 4) return seed; } #ifdef AV_READ_TIME