[FFmpeg-devel] [PATCH 1/7] avutil/random_seed: Avoid dead returns

Michael Niedermayer michael at niedermayer.cc
Tue May 21 05:46:46 EEST 2024


Fixes: CID1538296 Structurally dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavutil/random_seed.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index 6d399cee49c..8a4e4f1fc0b 100644
--- a/libavutil/random_seed.c
+++ b/libavutil/random_seed.c
@@ -158,10 +158,10 @@ int av_random_bytes(uint8_t* buf, size_t len)
 #elif CONFIG_OPENSSL
     if (RAND_bytes(buf, len) == 1)
         return 0;
-    err = AVERROR_EXTERNAL;
-#endif
-
+    return AVERROR_EXTERNAL;
+#else
     return err;
+#endif
 }
 
 uint32_t av_get_random_seed(void)
-- 
2.45.1



More information about the ffmpeg-devel mailing list