[FFmpeg-devel] [PATCH] avutil/random_seed: turn off buffering when reading from urandom

Marton Balint cus at passwd.hu
Sun Jul 9 11:48:40 EEST 2023


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavutil/random_seed.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index f167b172f2..6d399cee49 100644
--- a/libavutil/random_seed.c
+++ b/libavutil/random_seed.c
@@ -59,6 +59,7 @@ static int read_random(uint8_t *dst, size_t len, const char *file)
 
     if (!fp)
         return AVERROR_UNKNOWN;
+    setvbuf(fp, NULL, _IONBF, 0);
     err = fread(dst, 1, len, fp);
     fclose(fp);
 
-- 
2.35.3



More information about the ffmpeg-devel mailing list